mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
man.vim: workaround for 'cscopetag' #11679
The old `:Man` implementation would take either the word under the cursor, or the argument passed in, and load that as a man page. Since we now use 'tagfunc' and look for all relevant man-pages, if your system has several (i.e. same name, different sections), we return several, giving the user an option. This works for most tag commands except `:tjump`, which will fail if there's multiple tags to choose from. This just happens to be what the cscope code uses (it actually attempts to prompt the user, but this fails).
This commit is contained in:
parent
83b0054b87
commit
4a7d84ae60
@ -398,6 +398,11 @@ function! man#goto_tag(pattern, flags, info) abort
|
||||
" sort by relevance - exact matches first, then the previous order
|
||||
call sort(l:structured, { a, b -> a.name ==? l:name ? -1 : b.name ==? l:name ? 1 : 0 })
|
||||
|
||||
if &cscopetag
|
||||
" return only a single entry so we work well with :cstag (#11675)
|
||||
let l:structured = l:structured[:0]
|
||||
endif
|
||||
|
||||
return map(l:structured, {
|
||||
\ _, entry -> {
|
||||
\ 'name': entry.name,
|
||||
|
Loading…
Reference in New Issue
Block a user