Skip to content
Myr

[neovim] Fix error with {'window': 'enew'} (#274)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent a336494 · Browse files · 1 file+24 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+24 added−9 removed

  • other:+24 added−9 removed

1 file+24 added−9 removed

modified:plugin/fzf.vim+24 added-9 removed
246 unmodified lines
247 return min([a:max, a:val])248 endif249endfunction250251function! s:getpos()252 return {'tab': tabpagenr(), 'win': winnr()}253endfunction254255function! s:split(dict)256 let directions = {257 \ 'up': ['topleft', 'resize', &lines],258 \ 'down': ['botright', 'resize', &lines],259 \ 'left': ['vertical topleft', 'vertical resize', &columns],260 \ 'right': ['vertical botright', 'vertical resize', &columns] }257 let s:ptab = tabpagenr()261 let s:ppos = s:getpos()262 try263 for [dir, triple] in items(directions)264 let val = get(a:dict, dir, '')265 if !empty(val)
19 unmodified lines
285 call s:pushd(a:dict)286287 let fzf = { 'buf': bufnr('%'), 'dict': a:dict, 'temps': a:temps, 'name': 'FZF' }288 function! fzf.on_exit(id, code)289 let pos = s:getpos()290 let inplace = pos == s:ppos " {'window': 'enew'}285 let tab = tabpagenr()286 if bufnr('') == self.buf287 " We use close instead of bd! since Vim does not close the split when288 " there's no other listed buffer289 close291 if !inplace292 if bufnr('') == self.buf293 " We use close instead of bd! since Vim does not close the split when294 " there's no other listed buffer (nvim +'set nobuflisted')295 close296 endif297 if pos.tab == s:ppos.tab298 wincmd p299 endif300 endif291 if s:ptab == tab292 wincmd p293 endif301 call s:pushd(self.dict)302 try303 redraw!304 call s:callback(self.dict, self.temps)305306 if inplace && bufnr('') == self.buf307 execute "normal! \<c-^>"308 " No other listed buffer309 if bufnr('') == self.buf310 bd!311 endif312 endif313 finally314 call s:popd(self.dict)315 endtry316 endfunction
73 unmodified lines