Skip to main content
Module

x/ddc_vim/deps.ts>fn.bufnr

Dark deno-powered completion framework for neovim/Vim8
Go to Latest
function fn.bufnr
import { fn } from "https://deno.land/x/ddc_vim@v0.0.13/deps.ts";
const { bufnr } = fn;

The result is the number of a buffer, as it is displayed by the ":ls" command. For the use of {expr}, see |bufname()| above. If the buffer doesn't exist, -1 is returned. Or, if the {create} argument is present and not zero, a new, unlisted, buffer is created and its number is returned. bufnr("$") is the last buffer: :let last_buffer = bufnr("$") The result is a Number, which is the highest buffer number of existing buffers. Note that not all buffers with a smaller number necessarily exist, because ":bwipeout" may have removed them. Use bufexists() to test for the existence of a buffer.

Parameters

denops: Denops
optional
expr: string | number
optional
create: boolean

Returns

Promise<number>