Mercurial > vim
diff runtime/doc/tagsrch.txt @ 19968:1908e92b02fd
Update runtime files
Commit: https://github.com/vim/vim/commit/d1caa941d876181aae0ebebc6ea954045bf0da24
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Apr 10 22:10:56 2020 +0200
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 10 Apr 2020 22:15:05 +0200 |
parents | 51bc26d4a393 |
children | bd021eb62e73 |
line wrap: on
line diff
--- a/runtime/doc/tagsrch.txt +++ b/runtime/doc/tagsrch.txt @@ -1,4 +1,4 @@ -*tagsrch.txt* For Vim version 8.2. Last change: 2020 Jan 30 +*tagsrch.txt* For Vim version 8.2. Last change: 2020 Apr 03 VIM REFERENCE MANUAL by Bram Moolenaar @@ -185,6 +185,29 @@ commands explained above the tag stack w The |gettagstack()| function returns the tag stack of a specified window. The |settagstack()| function modifies the tag stack of a window. + *tagstack-examples* +Write to the tag stack just like `:tag` but with a user-defined +jumper#jump_to_tag function: > + " Store where we're jumping from before we jump. + let tag = expand('<cword>') + let pos = [bufnr()] + getcurpos()[1:] + let item = {'bufnr': pos[0], 'from': pos, 'tagname': tag} + if jumper#jump_to_tag(tag) + " Jump was successful, write previous location to tag stack. + let winid = win_getid() + let stack = gettagstack(winid) + let stack['items'] = [item] + call settagstack(winid, stack, 't') + endif +< +Set current index of the tag stack to 4: > + call settagstack(1005, {'curidx' : 4}) +< +Push a new item onto the tag stack: > + let pos = [bufnr('myfile.txt'), 10, 1, 0] + let newtag = [{'tagname' : 'mytag', 'from' : pos}] + call settagstack(2, {'items' : newtag}, 'a') +< *E73* When you try to use the tag stack while it doesn't contain anything you will get an error message.