man.vim: fixes to argument handling and parsing

- Define a collection of legal characters when parsing page and section
  in `s:parse_page_and_section()` instead of relying on 'iskeyword',
  which is unreliable.
- Allow non-numeric section names (e.g., `3c`).
- Simplify argument handling in `man#get_page()` to accommodate
  non-numeric section names.

Fixes #4165.
This commit is contained in:
Noah Frederick
2016-02-16 17:54:53 -05:00
parent 0e9f7a7b36
commit 9fb9d2929f
2 changed files with 10 additions and 19 deletions

View File

@@ -24,11 +24,11 @@ setlocal buftype=nofile noswapfile
setlocal nomodifiable readonly bufhidden=hide nobuflisted tabstop=8
if !exists("g:no_plugin_maps") && !exists("g:no_man_maps")
nnoremap <silent> <buffer> <C-]> :call man#get_page(v:count)<CR>
nnoremap <silent> <buffer> <C-]> :call man#get_page(v:count, expand('<cword>'))<CR>
nnoremap <silent> <buffer> <C-T> :call man#pop_page()<CR>
nnoremap <silent> <nowait><buffer> q <C-W>c
if &keywordprg !=# ':Man'
nnoremap <silent> <buffer> K :call man#get_page(v:count)<CR>
nnoremap <silent> <buffer> K :call man#get_page(v:count, expand('<cword>'))<CR>
endif
endif