mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 20:10:05 +08:00
fix(clipboard): return empty string
This commit is contained in:
parent
ee3ce867f4
commit
79378b0e4c
10
bundle/vim-clipboard/autoload/clipboard.vim
vendored
10
bundle/vim-clipboard/autoload/clipboard.vim
vendored
@ -49,8 +49,10 @@ function! s:set_command() abort
|
|||||||
return [yank, paste]
|
return [yank, paste]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" yank to system clipboard
|
||||||
function! clipboard#yank() abort
|
function! clipboard#yank() abort
|
||||||
call system(s:yank_cmd, GetSelectedText())
|
call system(s:yank_cmd, s:get_selection_text())
|
||||||
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
@ -62,9 +64,11 @@ function! clipboard#paste(mode) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! GetSelectedText()
|
function! s:get_selection_text()
|
||||||
|
let save_x = @x
|
||||||
normal gv"xy
|
normal gv"xy
|
||||||
let result = getreg("x")
|
let result = @x
|
||||||
|
let @x = save_x
|
||||||
return result
|
return result
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user