File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,14 @@ local function isVisualMode(mode)
31
31
or mode == TERM_CODES .CTRL_V
32
32
end
33
33
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
+
34
42
--- @param cur integer Undo sequence ID
35
43
--- @return string
36
44
local function undoItemId (cur )
@@ -1727,9 +1735,7 @@ end
1727
1735
--- Returns true if cursor is in select char/line/block mode
1728
1736
--- @return boolean
1729
1737
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 )
1733
1739
end
1734
1740
1735
1741
--- When cursors are disabled, only the main cursor can be interacted with.
@@ -2135,7 +2141,8 @@ local function updateCursorline()
2135
2141
return
2136
2142
end
2137
2143
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 )
2139
2146
if cursorline == state .cursorline and state .visual == visual then
2140
2147
return
2141
2148
end
You can’t perform that action at this time.
0 commit comments