aboutsummaryrefslogtreecommitdiff
path: root/runtime/autoload
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/autoload')
-rw-r--r--runtime/autoload/health/nvim.vim2
-rw-r--r--runtime/autoload/man.vim10
2 files changed, 8 insertions, 4 deletions
diff --git a/runtime/autoload/health/nvim.vim b/runtime/autoload/health/nvim.vim
index f3732e012f..9b387095ee 100644
--- a/runtime/autoload/health/nvim.vim
+++ b/runtime/autoload/health/nvim.vim
@@ -45,7 +45,7 @@ function! s:check_config() abort
let shadafile = empty(&shada) ? &shada : substitute(matchstr(
\ split(&shada, ',')[-1], '^n.\+'), '^n', '', '')
let shadafile = empty(&shadafile) ? empty(shadafile) ?
- \ stdpath('data').'/shada/main.shada' : expand(shadafile)
+ \ stdpath('state').'/shada/main.shada' : expand(shadafile)
\ : &shadafile ==# 'NONE' ? '' : &shadafile
if !empty(shadafile) && empty(glob(shadafile))
" Since this may be the first time neovim has been run, we will try to
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim
index 4d6a1f78dc..b8a73a64c9 100644
--- a/runtime/autoload/man.vim
+++ b/runtime/autoload/man.vim
@@ -125,9 +125,7 @@ endfunction
function! s:set_options(pager) abort
setlocal noswapfile buftype=nofile bufhidden=hide
setlocal nomodified readonly nomodifiable
- if a:pager
- nnoremap <silent> <buffer> <nowait> q :lclose<CR>:q<CR>
- endif
+ let b:pager = a:pager
setlocal filetype=man
endfunction
@@ -173,6 +171,12 @@ function! man#show_toc() abort
while lnum && lnum < last_line
let text = getline(lnum)
if text =~# '^\%( \{3\}\)\=\S.*$'
+ " if text is a section title
+ call add(toc, {'bufnr': bufnr('%'), 'lnum': lnum, 'text': text})
+ elseif text =~# '^\s\+\%(+\|-\)\S\+'
+ " if text is a flag title. we strip whitespaces and prepend two
+ " spaces to have a consistent format in the loclist.
+ let text = ' ' .. substitute(text, '^\s*\(.\{-}\)\s*$', '\1', '')
call add(toc, {'bufnr': bufnr('%'), 'lnum': lnum, 'text': text})
endif
let lnum = nextnonblank(lnum + 1)