mirror of
https://github.com/junegunn/fzf.vim.git
synced 2025-12-07 21:24:40 +08:00
@@ -183,7 +183,7 @@ function! s:ansi(str, group, default, ...)
|
|||||||
let fg = s:get_color('fg', a:group)
|
let fg = s:get_color('fg', a:group)
|
||||||
let bg = s:get_color('bg', a:group)
|
let bg = s:get_color('bg', a:group)
|
||||||
let color = s:csi(empty(fg) ? s:ansi[a:default] : fg, 1) .
|
let color = s:csi(empty(fg) ? s:ansi[a:default] : fg, 1) .
|
||||||
\ (empty(bg) ? '' : s:csi(bg, 0))
|
\ (empty(bg) ? '' : ';'.s:csi(bg, 0))
|
||||||
return printf("\x1b[%s%sm%s\x1b[m", color, a:0 ? ';1' : '', a:str)
|
return printf("\x1b[%s%sm%s\x1b[m", color, a:0 ? ';1' : '', a:str)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -348,10 +348,11 @@ function! fzf#vim#_lines(all)
|
|||||||
else
|
else
|
||||||
let bufname = ''
|
let bufname = ''
|
||||||
endif
|
endif
|
||||||
|
let linefmt = s:blue("%2d\t", "TabLine")."%s".s:yellow("\t%4d ", "LineNr")."\t%s"
|
||||||
call extend(b == buf ? cur : rest,
|
call extend(b == buf ? cur : rest,
|
||||||
\ filter(
|
\ filter(
|
||||||
\ map(lines,
|
\ map(lines,
|
||||||
\ '(!a:all && empty(v:val)) ? "" : printf(s:blue("%2d\t", "TabLine")."%s".s:yellow("\t%4d ", "LineNr")."\t%s", b, bufname, v:key + 1, v:val)'),
|
\ '(!a:all && empty(v:val)) ? "" : printf(linefmt, b, bufname, v:key + 1, v:val)'),
|
||||||
\ 'a:all || !empty(v:val)'))
|
\ 'a:all || !empty(v:val)'))
|
||||||
endfor
|
endfor
|
||||||
return [display_bufnames, extend(cur, rest)]
|
return [display_bufnames, extend(cur, rest)]
|
||||||
@@ -387,8 +388,8 @@ function! s:buffer_line_handler(lines)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:buffer_lines()
|
function! s:buffer_lines()
|
||||||
return map(getline(1, "$"),
|
let linefmt = s:yellow(" %4d ", "LineNr")."\t%s"
|
||||||
\ 'printf(s:yellow(" %4d ", "LineNr")."\t%s", v:key + 1, v:val)')
|
return map(getline(1, "$"), 'printf(linefmt, v:key + 1, v:val)')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! fzf#vim#buffer_lines(...)
|
function! fzf#vim#buffer_lines(...)
|
||||||
@@ -891,9 +892,11 @@ function! s:command_sink(lines)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
let s:fmt_excmd = ' '.s:blue('%-38s', 'Statement').'%s'
|
||||||
|
|
||||||
function! s:format_excmd(ex)
|
function! s:format_excmd(ex)
|
||||||
let match = matchlist(a:ex, '^|:\(\S\+\)|\s*\S*\(.*\)')
|
let match = matchlist(a:ex, '^|:\(\S\+\)|\s*\S*\(.*\)')
|
||||||
return printf(' '.s:blue('%-38s', 'Statement').'%s', s:nbs.match[1].s:nbs, s:strip(match[2]))
|
return printf(s:fmt_excmd, s:nbs.match[1].s:nbs, s:strip(match[2]))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:excmds()
|
function! s:excmds()
|
||||||
|
|||||||
Reference in New Issue
Block a user