Skip to content

Commit

Permalink
Restore current window settings after use
Browse files Browse the repository at this point in the history
  • Loading branch information
mperry2 committed May 14, 2022
1 parent fd3af75 commit ad0b2cb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugin/vim-pipe.vim
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ call s:SetGlobalOptDefault('vimpipe_silent', 0)

function! VimPipe() range "{{{1
" Save local settings.
let l:winview = winsaveview()
let saved_unnamed_register = @@
let switchbuf_before = &switchbuf
set switchbuf=useopen
Expand Down Expand Up @@ -105,6 +106,7 @@ function! VimPipe() range "{{{1
" Restore local settings.
let &switchbuf = switchbuf_before
let @@ = saved_unnamed_register
call winrestview(l:winview)
endfunction

" Define Mappings {{{1
Expand Down

0 comments on commit ad0b2cb

Please sign in to comment.