mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
man.vim: Use page title instead of full path. (#13353)
In commit 63f0ca3263
, `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
This commit is contained in:
parent
60158dfb81
commit
71d4f5851f
@ -434,8 +434,11 @@ function! man#goto_tag(pattern, flags, info) abort
|
|||||||
let l:structured = []
|
let l:structured = []
|
||||||
|
|
||||||
for l:path in l:paths
|
for l:path in l:paths
|
||||||
let l:n = s:extract_sect_and_name_path(l:path)[1]
|
let [l:sect, l:name] = s:extract_sect_and_name_path(l:path)
|
||||||
let l:structured += [{ 'name': l:n, 'path': l:path }]
|
let l:structured += [{
|
||||||
|
\ 'name': l:name,
|
||||||
|
\ 'title': l:name . '(' . l:sect . ')'
|
||||||
|
\ }]
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
if &cscopetag
|
if &cscopetag
|
||||||
@ -446,7 +449,7 @@ function! man#goto_tag(pattern, flags, info) abort
|
|||||||
return map(l:structured, {
|
return map(l:structured, {
|
||||||
\ _, entry -> {
|
\ _, entry -> {
|
||||||
\ 'name': entry.name,
|
\ 'name': entry.name,
|
||||||
\ 'filename': 'man://' . entry.path,
|
\ 'filename': 'man://' . entry.title,
|
||||||
\ 'cmd': '1'
|
\ 'cmd': '1'
|
||||||
\ }
|
\ }
|
||||||
\ })
|
\ })
|
||||||
|
Loading…
Reference in New Issue
Block a user