mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-05-17 05:49:48 +08:00
Compare commits
5 Commits
98dcd77a18
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| b9624aa012 | |||
| 34a564c81f | |||
| ddc14a6a54 | |||
| 879db51d09 | |||
| 3725f364cc |
@@ -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
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user