Skip to content

Commit

Permalink
Work around clipboard=unnamed
Browse files Browse the repository at this point in the history
  • Loading branch information
tpope committed Mar 19, 2009
1 parent 7998010 commit 2bafb77
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugin/unimpaired.vim
Expand Up @@ -188,7 +188,8 @@ endfunction

function! s:Transform(algorithm,type)
let sel_save = &selection
let &selection = "inclusive"
let cb_save = &clipboard
set selection=inclusive clipboard-=unnamed
let reg_save = @@
if a:type =~ '^\d\+$'
silent exe 'norm! ^v'.a:type.'$hy'
Expand All @@ -203,8 +204,9 @@ function! s:Transform(algorithm,type)
endif
let @@ = s:{a:algorithm}(@@)
norm! gvp
let &selection = sel_save
let @@ = reg_save
let &selection = sel_save
let &clipboard = cb_save
if a:type =~ '^\d\+$'
silent! call repeat#set("\<Plug>unimpairedLine".a:algorithm,a:type)
endif
Expand Down

0 comments on commit 2bafb77

Please sign in to comment.