Skip to main content
Module

x/ddc_vim/deps.ts>fn.bufexists

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

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

If the {expr} 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.

Parameters

denops: Denops
expr: string | number

Returns

Promise<boolean>