aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/ftplugin/help.vim4
-rw-r--r--runtime/ftplugin/qf.vim23
-rw-r--r--runtime/syntax/qf.vim6
3 files changed, 8 insertions, 25 deletions
diff --git a/runtime/ftplugin/help.vim b/runtime/ftplugin/help.vim
index a6a6652b2f..a188e45cb4 100644
--- a/runtime/ftplugin/help.vim
+++ b/runtime/ftplugin/help.vim
@@ -71,7 +71,7 @@ if !exists('g:no_plugin_maps')
if indent(lnum) <= indent(l)
let level = has_section + has_sub_section
- let add_text = matchstr(text, '\S.*')
+ let add_text = matchstr(text, '\S.\{-}\ze\s\=\~$')
endif
endif
@@ -79,7 +79,7 @@ if !exists('g:no_plugin_maps')
if !empty(add_text) && last_added != lnum
let last_added = lnum
call add(toc, {'bufnr': bufnr('%'), 'lnum': lnum,
- \ 'text': repeat(' ', level) . add_text})
+ \ 'text': repeat("\u00a0\u00a0", level) . add_text})
endif
let lnum = nextnonblank(lnum + 1)
endwhile
diff --git a/runtime/ftplugin/qf.vim b/runtime/ftplugin/qf.vim
index a3dfce0e76..85fb9f6125 100644
--- a/runtime/ftplugin/qf.vim
+++ b/runtime/ftplugin/qf.vim
@@ -16,26 +16,3 @@ if !get(g:, 'qf_disable_statusline')
" Display the command that produced the list in the quickfix window:
setlocal stl=%t%{exists('w:quickfix_title')?\ '\ '.w:quickfix_title\ :\ ''}\ %=%-15(%l,%c%V%)\ %P
endif
-
-function! s:setup_toc() abort
- if get(w:, 'quickfix_title') !~# '\<TOC$' || &syntax != 'qf'
- return
- endif
-
- let list = getloclist(0)
- if empty(list)
- return
- endif
-
- let bufnr = list[0].bufnr
- setlocal modifiable
- silent %delete _
- call setline(1, map(list, 'v:val.text'))
- setlocal nomodifiable nomodified
- let &syntax = getbufvar(bufnr, '&syntax')
-endfunction
-
-augroup qf_toc
- autocmd!
- autocmd Syntax <buffer> call s:setup_toc()
-augroup END
diff --git a/runtime/syntax/qf.vim b/runtime/syntax/qf.vim
index 6f2ea6a92e..3131caccd8 100644
--- a/runtime/syntax/qf.vim
+++ b/runtime/syntax/qf.vim
@@ -15,6 +15,12 @@ syn match qfSeparator "|" nextgroup=qfLineNr contained
syn match qfLineNr "[^|]*" contained contains=qfError
syn match qfError "error" contained
+" Hide file name and line number for help outline (TOC).
+if has_key(w:, 'qf_toc') || get(w:, 'quickfix_title') =~# '\<TOC$'
+ setlocal conceallevel=3 concealcursor=nc
+ syn match Ignore "^[^|]*|[^|]*| " conceal
+endif
+
" The default highlighting.
hi def link qfFileName Directory
hi def link qfLineNr LineNr