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