Skip to content

Commit b216737

Browse files
committed
tweak
1 parent df05eef commit b216737

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

lua/multicursor-nvim/cursor-manager.lua

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ local function isVisualMode(mode)
3131
or mode == TERM_CODES.CTRL_V
3232
end
3333

34+
--- @param mode string
35+
--- @return boolean
36+
local function isSelectMode(mode)
37+
return mode == "s"
38+
or mode == "S"
39+
or mode == TERM_CODES.CTRL_S
40+
end
41+
3442
--- @param cur integer Undo sequence ID
3543
--- @return string
3644
local function undoItemId(cur)
@@ -1727,9 +1735,7 @@ end
17271735
--- Returns true if cursor is in select char/line/block mode
17281736
--- @return boolean
17291737
function Cursor:inSelectMode()
1730-
return self._mode == "s"
1731-
or self._mode == "S"
1732-
or self._mode == TERM_CODES.CTRL_S
1738+
return isSelectMode(self._mode)
17331739
end
17341740

17351741
--- When cursors are disabled, only the main cursor can be interacted with.
@@ -2135,7 +2141,8 @@ local function updateCursorline()
21352141
return
21362142
end
21372143
local cursorline = vim.o.cursorline
2138-
local visual = isVisualMode(vim.fn.mode())
2144+
local mode = vim.fn.mode()
2145+
local visual = isVisualMode(mode) or isSelectMode(mode)
21392146
if cursorline == state.cursorline and state.visual == visual then
21402147
return
21412148
end

0 commit comments

Comments
 (0)