From 6fa50980ca86b00de5629cafe96a85280f2b0c1b Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 8 Apr 2018 00:07:21 +0200 Subject: Echo tabs with "Tab page X" lines highlighted in the "Title" group Makes the "Tab page X" lines appear in the same colour as they usually do when using the `:tabs` command. --- plugin/tabs_grep.vim | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/plugin/tabs_grep.vim b/plugin/tabs_grep.vim index 644bf44..d9abe40 100644 --- a/plugin/tabs_grep.vim +++ b/plugin/tabs_grep.vim @@ -9,9 +9,8 @@ function! TabsGrep(search) call filter(tabs, function('s:MatchString', [a:search])) let tabs = s:FilterTabPageElements(tabs) - for line in tabs - echo line - endfor + + call s:EchoTabs(tabs) endfunction function! s:MatchString(search, index, value) @@ -61,4 +60,16 @@ function! s:FilterTabPageElements(list) return a:list endfunction +function! s:EchoTabs(tab_list) + for line in a:tab_list + if s:IsTabPageLine(line) + echohl Title + echo line + echohl None + else + echo line + endif + endfor +endfunction + command! -nargs=1 TabsGrep :call TabsGrep() -- cgit v1.2.3