aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshade-of-noon <73705427+shade-of-noon@users.noreply.github.com>2020-11-24 04:48:06 -0400
committerGitHub <noreply@github.com>2020-11-24 09:48:06 +0100
commit71d4f5851f068eeb432af34850dddda8cc1c71e3 (patch)
tree62d793afb108c29559c0350cbdb8039df0ded2d1
parent60158dfb818cbc8132da31bdf3ab77def9bf070e (diff)
downloadrneovim-71d4f5851f068eeb432af34850dddda8cc1c71e3.tar.gz
rneovim-71d4f5851f068eeb432af34850dddda8cc1c71e3.tar.bz2
rneovim-71d4f5851f068eeb432af34850dddda8cc1c71e3.zip
man.vim: Use page title instead of full path. (#13353)
In commit 63f0ca326322376271, `tagfunc` was introduced to `runtime/autoload/man.vim`. Nonetheless the tag function instead of using a short buffer name (e.g. `man://foo(3)`) uses the full path to the man page (e.g. `man:///usr/share/.../foo.3.gz`). This behaviour is inconsistent with `:Man!`, thus this commit. Closes #13334
-rw-r--r--runtime/autoload/man.vim9
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim
index 5008b8cfaf..486ed99e3f 100644
--- a/runtime/autoload/man.vim
+++ b/runtime/autoload/man.vim
@@ -434,8 +434,11 @@ function! man#goto_tag(pattern, flags, info) abort
let l:structured = []
for l:path in l:paths
- let l:n = s:extract_sect_and_name_path(l:path)[1]
- let l:structured += [{ 'name': l:n, 'path': l:path }]
+ let [l:sect, l:name] = s:extract_sect_and_name_path(l:path)
+ let l:structured += [{
+ \ 'name': l:name,
+ \ 'title': l:name . '(' . l:sect . ')'
+ \ }]
endfor
if &cscopetag
@@ -446,7 +449,7 @@ function! man#goto_tag(pattern, flags, info) abort
return map(l:structured, {
\ _, entry -> {
\ 'name': entry.name,
- \ 'filename': 'man://' . entry.path,
+ \ 'filename': 'man://' . entry.title,
\ 'cmd': '1'
\ }
\ })