5 Commits

Author SHA1 Message Date
Junegunn Choi b9624aa012 Do not display statusline when fzf is running in a floating window
Related: #1615
2026-04-10 21:30:27 +09:00
Junegunn Choi 34a564c81f Update README 2026-02-02 09:42:52 +09:00
Enno ddc14a6a54 Avoid cooked terminal mode (#1604)
as `:help system()` states

		When prepended by |:silent| the terminal will not be set to
		cooked mode.  This is meant to be used for commands that do
		not need the user to type.  It avoids stray characters showing
		up on the screen which require |CTRL-L| to remove. >
			:silent let f = system('ls *.vim')
2025-12-09 08:49:13 +09:00
Junegunn Choi 879db51d09 Update README.md 2025-09-03 09:59:37 +09:00
phanium 3725f364cc Fix cmd hisotry correctly (#1594) 2025-06-20 17:04:48 +09:00
2 changed files with 17 additions and 12 deletions
+4 -5
View File
@@ -669,9 +669,8 @@ function! s:history_sink(type, lines)
let key = a:lines[0] let key = a:lines[0]
let item = matchstr(a:lines[1], ' *[0-9]\+ *\zs.*') let item = matchstr(a:lines[1], ' *[0-9]\+ *\zs.*')
if key == 'ctrl-e' if key == 'ctrl-e'
call histadd(a:type, item)
redraw redraw
call feedkeys(a:type."\<up>", 'n') call feedkeys(a:type.item, 'nt')
else else
if a:type == ':' if a:type == ':'
call histadd(a:type, item) call histadd(a:type, item)
@@ -719,7 +718,7 @@ function! s:get_git_root(dir)
return FugitiveWorkTree() return FugitiveWorkTree()
endif endif
let dir = len(a:dir) ? a:dir : substitute(split(expand('%:p:h'), '[/\\]\.git\([/\\]\|$\)')[0], '^fugitive://', '', '') let dir = len(a:dir) ? a:dir : substitute(split(expand('%:p:h'), '[/\\]\.git\([/\\]\|$\)')[0], '^fugitive://', '', '')
let root = systemlist('git -C ' . shellescape(dir) . ' rev-parse --show-toplevel')[0] silent let root = systemlist('git -C ' . shellescape(dir) . ' rev-parse --show-toplevel')[0]
return v:shell_error ? '' : (len(a:dir) ? fnamemodify(a:dir, ':p') : root) return v:shell_error ? '' : (len(a:dir) ? fnamemodify(a:dir, ':p') : root)
endfunction endfunction
@@ -1236,9 +1235,9 @@ function! s:command_sink(lines)
endif endif
let cmd = matchstr(a:lines[1], s:tab.'\zs\S*\ze'.s:tab) let cmd = matchstr(a:lines[1], s:tab.'\zs\S*\ze'.s:tab)
if empty(a:lines[0]) if empty(a:lines[0])
call feedkeys(':'.cmd.(a:lines[1][0] == '!' ? '' : ' '), 'n') call feedkeys(':'.cmd.(a:lines[1][0] == '!' ? '' : ' '), 'nt')
else else
call feedkeys(':'.cmd."\<cr>", 'n') call feedkeys(':'.cmd."\<cr>", 'nt')
endif endif
endfunction endfunction
+13 -7
View File
@@ -98,14 +98,20 @@ if (has('nvim') || has('terminal') && has('patch-8.0.995')) && (s:conf('statusli
if exists('#User#FzfStatusLine') if exists('#User#FzfStatusLine')
doautocmd User FzfStatusLine doautocmd User FzfStatusLine
else else
if $TERM !~ "256color" " Do not display statusline when fzf is running in a floating window
highlight default fzf1 ctermfg=1 ctermbg=8 guifg=#E12672 guibg=#565656 " (e.g. nvim-fzf)
highlight default fzf2 ctermfg=2 ctermbg=8 guifg=#BCDDBD guibg=#565656 if has('nvim') && len(nvim_win_get_config(0).relative)
highlight default fzf3 ctermfg=7 ctermbg=8 guifg=#D9D9D9 guibg=#565656 return
endif
if has('termguicolors') && &termguicolors || $TERM =~ "256color"
highlight default fzf1 ctermfg=161 ctermbg=238 guifg=#E12672 guibg=#565656 gui=nocombine
highlight default fzf2 ctermfg=151 ctermbg=238 guifg=#BCDDBD guibg=#565656 gui=nocombine
highlight default fzf3 ctermfg=252 ctermbg=238 guifg=#D9D9D9 guibg=#565656 gui=nocombine
else else
highlight default fzf1 ctermfg=161 ctermbg=238 guifg=#E12672 guibg=#565656 highlight default fzf1 ctermfg=1 ctermbg=8 guifg=#E12672 guibg=#565656 gui=nocombine
highlight default fzf2 ctermfg=151 ctermbg=238 guifg=#BCDDBD guibg=#565656 highlight default fzf2 ctermfg=2 ctermbg=8 guifg=#BCDDBD guibg=#565656 gui=nocombine
highlight default fzf3 ctermfg=252 ctermbg=238 guifg=#D9D9D9 guibg=#565656 highlight default fzf3 ctermfg=7 ctermbg=8 guifg=#D9D9D9 guibg=#565656 gui=nocombine
endif endif
setlocal statusline=%#fzf1#\ >\ %#fzf2#fz%#fzf3#f setlocal statusline=%#fzf1#\ >\ %#fzf2#fz%#fzf3#f
endif endif