mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 02:20:03 +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
|
||||
return ''
|
||||
endif
|
||||
let lines[-1] = lines[-1][: column_end - (&selection ==# 'inclusive' ? 1 : 2)]
|
||||
let lines[0] = lines[0][column_start - 1:]
|
||||
" check v-block mode
|
||||
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")
|
||||
endfunction
|
||||
|
Loading…
Reference in New Issue
Block a user