Skip to content

Commit

Permalink
👍 Add swapname() to buffer-function
Browse files Browse the repository at this point in the history
  • Loading branch information
Milly committed May 11, 2023
1 parent 69ff43e commit 9f191ba
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
16 changes: 0 additions & 16 deletions denops_std/function/_generated.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions denops_std/function/buffer.ts
Expand Up @@ -667,3 +667,21 @@ export async function setbufvar(
): Promise<void> {
await denops.call("setbufvar", buf, varname, val);
}

/**
* The result is the swap file path of the buffer **{expr}**.
* For the use of **{buf}**, see `bufname()` above.
* If buffer **{buf}** is the current buffer, the result is equal to
* `:swapname` (unless there is no swap file).
* If buffer **{buf}** has no swap file, returns an empty string.
*
* Can also be used as a `method`:
*
* GetBufname()->swapname()
*/
export async function swapname(
denops: Denops,
buf: BufNameArg,
): Promise<string> {
return await denops.call("swapname", buf) as string;
}

0 comments on commit 9f191ba

Please sign in to comment.