mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-26 23:06:34 +00:00
Merge pull request #264 from kassio/master
Do not rename terminal buffer
This commit is contained in:
commit
2e84b1db64
@ -98,7 +98,7 @@ function! fzf#run(...) abort
|
|||||||
try
|
try
|
||||||
let oshell = &shell
|
let oshell = &shell
|
||||||
set shell=sh
|
set shell=sh
|
||||||
if has('nvim') && bufexists('[FZF]')
|
if has('nvim') && bufexists('term://*:FZF')
|
||||||
echohl WarningMsg
|
echohl WarningMsg
|
||||||
echomsg 'FZF is already running!'
|
echomsg 'FZF is already running!'
|
||||||
echohl None
|
echohl None
|
||||||
@ -280,17 +280,13 @@ function! s:execute_term(dict, command, temps)
|
|||||||
call s:split(a:dict)
|
call s:split(a:dict)
|
||||||
call s:pushd(a:dict)
|
call s:pushd(a:dict)
|
||||||
|
|
||||||
let fzf = { 'buf': bufnr('%'), 'dict': a:dict, 'temps': a:temps }
|
let fzf = { 'buf': bufnr('%'), 'dict': a:dict, 'temps': a:temps, 'name': 'FZF' }
|
||||||
function! fzf.on_exit(id, code)
|
function! fzf.on_exit(id, code)
|
||||||
let tab = tabpagenr()
|
let tab = tabpagenr()
|
||||||
if bufnr('') == self.buf
|
if bufnr('') == self.buf
|
||||||
" We use close instead of bd! since Vim does not close the split when
|
" We use close instead of bd! since Vim does not close the split when
|
||||||
" there's no other listed buffer
|
" there's no other listed buffer
|
||||||
close
|
close
|
||||||
" FIXME This should be unnecessary due to `bufhidden=wipe` but in some
|
|
||||||
" cases Neovim fails to clean up the buffer and `bufexists('[FZF]')
|
|
||||||
" returns 1 even when it cannot be seen anywhere else. e.g. `FZF!`
|
|
||||||
silent! execute 'bd!' self.buf
|
|
||||||
endif
|
endif
|
||||||
if s:ptab == tab
|
if s:ptab == tab
|
||||||
wincmd p
|
wincmd p
|
||||||
@ -305,7 +301,6 @@ function! s:execute_term(dict, command, temps)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call termopen(a:command, fzf)
|
call termopen(a:command, fzf)
|
||||||
silent file [FZF]
|
|
||||||
startinsert
|
startinsert
|
||||||
return []
|
return []
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
Reference in New Issue
Block a user