1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 02:20:05 +08:00

Add visual selection support

This commit is contained in:
wsdjeg 2018-01-18 19:36:10 +08:00
parent 8a20f77077
commit 75ca118c1a

View File

@ -310,7 +310,17 @@ function! s:highlight_cursor() abort
\ }
hi def link SpaceVimGuideCursor Cursor
call s:VIMH.hi(info)
let s:cursor_hi = matchaddpos('SpaceVimGuideCursor', [[line('.'), col('.'), 1]])
if s:vis == 'gv'
" [bufnum, lnum, col, off]
let begin = getpos("'<")
let end = getpos("'>")
if begin[1] == end[1]
let s:cursor_hi = matchaddpos('SpaceVimGuideCursor', [[begin[1], min([begin[2], end[2]]), abs(begin[2] - end[2]) + 1]])
else
endif
else
let s:cursor_hi = matchaddpos('SpaceVimGuideCursor', [[line('.'), col('.'), 1]])
endif
endfunction
function! s:remove_cursor_highlight() abort