import * as denopsStd from "https://deno.land/x/denops_std@v4.1.5/function/buffer.ts";
Functions
Add a buffer to the buffer list with name {name} (must be a String). If a buffer for file {name} already exists, return that buffer number. Otherwise return the buffer number of the newly created buffer. When {name} is an empty string then a new buffer is always created. The buffer will not have 'buflisted' set and not be loaded yet. To add some text to the buffer use this: let bufnr = bufadd('someName') call bufload(bufnr) call setbufline(bufnr, 1, ['some', 'text']) Returns 0 on error. Can also be used as a |method|: let bufnr = 'somename'->bufadd() | |
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. | |
The result is a Number, which is |TRUE| if a buffer called {buf} exists and is listed (has the 'buflisted' option set). The {buf} argument is used like with |bufexists()|. | |
Ensure the buffer {buf} is loaded. When the buffer name refers to an existing file then the file is read. Otherwise the buffer will be empty. If the buffer was already loaded then there is no change. If the buffer is not related to a file the no file is read (e.g., when 'buftype' is "nofile"). If there is an existing swap file for the file of the buffer, there will be no dialog, the buffer will be loaded anyway. The {buf} argument is used like with |bufexists()|. | |
The result is a Number, which is |TRUE| if a buffer called {buf} exists and is loaded (shown in a window or hidden). The {buf} argument is used like with |bufexists()|. | |
The result is the name of a buffer. Mostly as it is displayed
by the | |
The result is the number of a buffer, as it is displayed by
the | |
The result is a Number, which is the |window-ID| of the first window associated with buffer {buf}. For the use of {buf}, see |bufname()| above. If buffer {buf} doesn't exist or there is no such window, -1 is returned. Example: | |
Like |bufwinid()| but return the window number instead of the |window-ID|. If buffer {buf} doesn't exist or there is no such window, -1 is returned. Example: | |
Return a |List| with the lines starting from {lnum} to {end} (inclusive) in the buffer {buf}. If {end} is omitted, a |List| with only the line {lnum} is returned. | |
Set line {lnum} to {text} in buffer {buf}. This works like |setline()| for the specified buffer. |