diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2016-12-11 22:32:40 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2016-12-11 22:32:59 +0900 |
| commit | c60bfb2b0f96b50790f66c2d534e17098e6e690a (patch) | |
| tree | e3693a1c02974d4bd8c423f98b50b48b8f8c9f99 | |
| parent | 16b5902aa278639fd99be89abe8ac50eb49b34aa (diff) | |
| download | fzf-c60bfb2b0f96b50790f66c2d534e17098e6e690a.tar.gz | |
[neovim] Keep alternate file unchanged
Close https://github.com/junegunn/fzf.vim/issues/265
| -rw-r--r-- | plugin/fzf.vim | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 09999649..065701cc 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -430,7 +430,7 @@ function! s:split(dict) let ppos = s:getpos() try if s:present(a:dict, 'window') - execute a:dict.window + execute 'keepalt' a:dict.window elseif !s:splittable(a:dict) execute (tabpagenr()-1).'tabnew' else @@ -457,15 +457,14 @@ endfunction function! s:execute_term(dict, command, temps) abort let winrest = winrestcmd() + let pbuf = bufnr('') let [ppos, winopts] = s:split(a:dict) - let fzf = { 'buf': bufnr('%'), 'ppos': ppos, 'dict': a:dict, 'temps': a:temps, + let fzf = { 'buf': bufnr(''), 'pbuf': pbuf, 'ppos': ppos, 'dict': a:dict, 'temps': a:temps, \ 'winopts': winopts, 'winrest': winrest, 'lines': &lines, \ 'columns': &columns, 'command': a:command } function! fzf.switch_back(inplace) if a:inplace && bufnr('') == self.buf - " FIXME: Can't re-enter normal mode from terminal mode - " execute "normal! \<c-^>" - b # + execute 'keepalt b' self.pbuf " No other listed buffer if bufnr('') == self.buf enew |
