Skip to main content
Module

x/denops_std/function/mod.ts>settagstack

📚 Standard module for denops.vim
Go to Latest
function settagstack
import { settagstack } from "https://deno.land/x/denops_std@v6.4.0/function/mod.ts";

Modify the tag stack of the window {nr} using {dict}. {nr} can be the window number or the window-ID.

For a list of supported items in {dict}, refer to gettagstack(). "curidx" takes effect before changing the tag stack.

How the tag stack is modified depends on the {action} argument:

  • If {action} is not present or is set to 'r', then the tag stack is replaced.
  • If {action} is set to 'a', then new entries from {dict} are pushed (added) onto the tag stack.
  • If {action} is set to 't', then all the entries from the current entry in the tag stack or "curidx" in {dict} are removed and then new entries are pushed to the stack.

The current index is set to one after the length of the tag stack after the modification.

Returns zero for success, -1 for failure.

Examples (for more examples see tagstack-examples): Empty the tag stack of window 3:

    call settagstack(3, {'items' : []})

Save and restore the tag stack:

    let stack = gettagstack(1003)
    " do something else
    call settagstack(1003, stack)
    unlet stack

Can also be used as a method, the base is passed as the second argument:

GetStack()->settagstack(winnr)

Parameters

denops: Denops
nr: unknown
dict: unknown
optional
action: unknown

Returns

Promise<number>