aboutsummaryrefslogtreecommitdiff
path: root/runtime/autoload
diff options
context:
space:
mode:
authorRob Pilling <robpilling@gmail.com>2019-10-22 23:40:16 +0100
committerRob Pilling <robpilling@gmail.com>2019-10-24 21:15:18 +0100
commit63f0ca326322376271c68f51cf8908daad524339 (patch)
tree6a5e33385b6025e6fd37b074154e52927d04ba90 /runtime/autoload
parented72d9597d61f4f32162b7810dc93469bcee1ce8 (diff)
downloadrneovim-63f0ca326322376271c68f51cf8908daad524339.tar.gz
rneovim-63f0ca326322376271c68f51cf8908daad524339.tar.bz2
rneovim-63f0ca326322376271c68f51cf8908daad524339.zip
man.vim: use 'tagfunc' instead of remapping
man#pop_tag() is also no longer used
Diffstat (limited to 'runtime/autoload')
-rw-r--r--runtime/autoload/man.vim23
1 files changed, 15 insertions, 8 deletions
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim
index ec48d96dd6..8825719ec7 100644
--- a/runtime/autoload/man.vim
+++ b/runtime/autoload/man.vim
@@ -264,14 +264,6 @@ function! s:push_tag() abort
\ }]
endfunction
-function! man#pop_tag() abort
- if !empty(s:tag_stack)
- let tag = remove(s:tag_stack, -1)
- execute 'silent' tag['buf'].'buffer'
- call cursor(tag['lnum'], tag['col'])
- endif
-endfunction
-
" extracts the name and sect out of 'path/name.sect'
function! s:extract_sect_and_name_path(path) abort
let tail = fnamemodify(a:path, ':t')
@@ -410,4 +402,19 @@ function! man#init_pager() abort
endif
endfunction
+function! man#goto_tag(pattern, flags, info) abort
+ " currently no support for section completion
+ let sect = ""
+
+ let candidates = s:get_paths(sect, a:pattern)
+
+ return map(candidates, {
+ \ _, path -> {
+ \ 'name': s:extract_sect_and_name_path(path)[1],
+ \ 'filename': 'man://' . path,
+ \ 'cmd': '1'
+ \ }
+ \ })
+endfunction
+
call s:init()