diff --git a/unmanaged-vim-plug/fuzzyfinder/autoload/fuf.vim b/unmanaged-vim-plug/fuzzyfinder/autoload/fuf.vim index fe9e6eb..78be490 100644 --- a/unmanaged-vim-plug/fuzzyfinder/autoload/fuf.vim +++ b/unmanaged-vim-plug/fuzzyfinder/autoload/fuf.vim @@ -706,6 +706,11 @@ let s:FUF_BUF_NAME = '[fuf]' " function s:activateFufBuffer() + " Save the last window number so we can switch back to it later (otherwise, + " at least with more recent versions of Vim, we end up with the top left + " window focused) + let s:fuf_buffer_last_winnr = winnr() + " lcd . : To avoid the strange behavior that unnamed buffer changes its cwd " if 'autochdir' was set on. lcd . @@ -733,6 +738,7 @@ function s:deactivateFufBuffer() AutoComplPopUnlock endif call l9#tempbuffer#close(s:FUF_BUF_NAME) + exec s:fuf_buffer_last_winnr . "wincmd w" endfunction " }}}1 diff --git a/unmanaged-vim-plug/fuzzyfinder/fd41e8d68b6774324b58c02692b896a6a36a0397.patch b/unmanaged-vim-plug/fuzzyfinder/fd41e8d68b6774324b58c02692b896a6a36a0397.patch new file mode 100644 index 0000000..7e85408 --- /dev/null +++ b/unmanaged-vim-plug/fuzzyfinder/fd41e8d68b6774324b58c02692b896a6a36a0397.patch @@ -0,0 +1,36 @@ +From fd41e8d68b6774324b58c02692b896a6a36a0397 Mon Sep 17 00:00:00 2001 +From: David Wolever +Date: Thu, 1 Jun 2017 10:11:43 -0400 +Subject: [PATCH] Fix focus top left window bug + +With newer versions of Vim, the top left window will be focused after +opening the fuf menu. This patch restores the window focus after the +menu is closed. +--- + autoload/fuf.vim | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/autoload/fuf.vim b/autoload/fuf.vim +index fe9e6eb..78be490 100644 +--- a/autoload/fuf.vim ++++ b/autoload/fuf.vim +@@ -706,6 +706,11 @@ let s:FUF_BUF_NAME = '[fuf]' + + " + function s:activateFufBuffer() ++ " Save the last window number so we can switch back to it later (otherwise, ++ " at least with more recent versions of Vim, we end up with the top left ++ " window focused) ++ let s:fuf_buffer_last_winnr = winnr() ++ + " lcd . : To avoid the strange behavior that unnamed buffer changes its cwd + " if 'autochdir' was set on. + lcd . +@@ -733,6 +738,7 @@ function s:deactivateFufBuffer() + AutoComplPopUnlock + endif + call l9#tempbuffer#close(s:FUF_BUF_NAME) ++ exec s:fuf_buffer_last_winnr . "wincmd w" + endfunction + + " }}}1