Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ddc_vim/deps.ts>fn.bufexists

Dark deno-powered completion framework for neovim/Vim
Go to Latest
function fn.bufexists
import { fn } from "https://deno.land/x/ddc_vim@v4.1.0/deps.ts";
const { bufexists } = fn;

The result is a Number, which is TRUE if a buffer called {buf} exists. If the {buf} argument is a number, buffer numbers are used. Number zero is the alternate buffer for the current window.

If the {buf} argument is a string it must match a buffer name exactly. The name can be:

  • Relative to the current directory.
  • A full path.
  • The name of a buffer with 'buftype' set to "nofile".
  • A URL name. Unlisted buffers will be found. Note that help files are listed by their short name in the output of :buffers, but bufexists() requires using their long name to be able to find them. bufexists() may report a buffer exists, but to use the name with a :buffer command you may need to use expand(). Esp for MS-Windows 8.3 names in the form "c:\DOCUME~1" Use "bufexists(0)" to test for the existence of an alternate file name.

Can also be used as a method:

let exists = 'somename'->bufexists()

Obsolete name: buffer_exists().

Returns

Promise<boolean>