From ad0b2cba731a2458e5c52e364f0f164fe6416956 Mon Sep 17 00:00:00 2001 From: Matt Perry Date: Sat, 14 May 2022 00:57:23 -0700 Subject: [PATCH] Restore current window settings after use --- plugin/vim-pipe.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin/vim-pipe.vim b/plugin/vim-pipe.vim index 11e8951..dfbe383 100644 --- a/plugin/vim-pipe.vim +++ b/plugin/vim-pipe.vim @@ -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 @@ -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