From 7ae9fb4f83c6af48111206089158c24b60616adb Mon Sep 17 00:00:00 2001 From: Wang Shidong Date: Wed, 10 Feb 2021 14:55:39 +0800 Subject: [PATCH] Update visual_selection function (#4078) --- autoload/SpaceVim/plugins/pastebin.vim | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/autoload/SpaceVim/plugins/pastebin.vim b/autoload/SpaceVim/plugins/pastebin.vim index c7344697e..850fc1a57 100644 --- a/autoload/SpaceVim/plugins/pastebin.vim +++ b/autoload/SpaceVim/plugins/pastebin.vim @@ -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() ==# "\" + 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