mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 05:30:07 +08:00
Update visual_selection function (#4078)
This commit is contained in:
parent
a61ae055b1
commit
7ae9fb4f83
@ -64,7 +64,15 @@ function! s:get_visual_selection() abort
|
|||||||
if len(lines) == 0
|
if len(lines) == 0
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
let lines[-1] = lines[-1][: column_end - (&selection ==# 'inclusive' ? 1 : 2)]
|
" check v-block mode
|
||||||
let lines[0] = lines[0][column_start - 1:]
|
if visualmode() ==# "\<C-v>"
|
||||||
|
for i in range(len(lines))
|
||||||
|
let lines[i] = lines[i][: column_end - (&selection ==# 'inclusive' ? 1 : 2)]
|
||||||
|
let lines[i] = lines[i][column_start - 1:]
|
||||||
|
endfor
|
||||||
|
else
|
||||||
|
let lines[-1] = lines[-1][: column_end - (&selection ==# 'inclusive' ? 1 : 2)]
|
||||||
|
let lines[0] = lines[0][column_start - 1:]
|
||||||
|
endif
|
||||||
return join(lines, "\n")
|
return join(lines, "\n")
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
Reference in New Issue
Block a user