Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/denops_std/function/nvim/mod.ts>nvim_buf_call

๐Ÿ“š Standard module for denops.vim
Go to Latest
function nvim_buf_call
import { nvim_buf_call } from "https://deno.land/x/denops_std@v4.1.4/function/nvim/mod.ts";

call a function with buffer as temporary current buffer This temporarily switches current buffer to "buffer". If the current window already shows "buffer", the window is not switched If a window inside the current tabpage (including a float) already shows the buffer One of these windows will be set as current window temporarily. Otherwise a temporary scratch window (called the "autocmd window" for historical reasons) will be used. This is useful e.g. to call vimL functions that only work with the current buffer/window currently, like |termopen()|. Attributes: ~ |vim.api| only Parameters: ~ {buffer} Buffer handle, or 0 for current buffer {fun} Function to call inside the buffer (currently lua callable only) Return: ~ Return value of function. NB: will deepcopy lua values currently, use upvalues to send lua references in and out.

Parameters

denops: Denops
buffer: unknown
fun: unknown

Returns

Promise<unknown>