diff --git a/denops_std/function/_generated.ts b/denops_std/function/_generated.ts index a6c2f2ce..a54289e8 100644 --- a/denops_std/function/_generated.ts +++ b/denops_std/function/_generated.ts @@ -134,45 +134,6 @@ export function append(denops: Denops, ...args: unknown[]): Promise { return denops.call("append", ...args); } -/** - * Like `append()` but append the text in buffer **{buf}**. - * - * This function works only for loaded buffers. First call - * `bufload()` if needed. - * - * For the use of **{buf}**, see `bufname()`. - * - * **{lnum}** is the line number to append below. Note that using - * `line()` would use the current buffer, not the one appending - * to. Use "$" to append at the end of the buffer. Other string - * values are not supported. - * - * On success 0 is returned, on failure 1 is returned. - * In `Vim9` script an error is given for an invalid **{lnum}**. - * - * If **{buf}** is not a valid buffer or **{lnum}** is not valid, an - * error message is given. Example: - * - * :let failed = appendbufline(13, 0, "# THE START") - * - * Can also be used as a `method` after a List, the base is - * passed as the second argument: - * - * mylist->appendbufline(buf, lnum) - */ -export function appendbufline( - denops: Denops, - buf: unknown, - lnum: unknown, - text: unknown, -): Promise; -export function appendbufline( - denops: Denops, - ...args: unknown[] -): Promise { - return denops.call("appendbufline", ...args); -} - /** * The result is the number of files in the argument list. See * `arglist`. @@ -1175,37 +1136,6 @@ export function delete_(denops: Denops, ...args: unknown[]): Promise { return denops.call("delete_", ...args); } -/** - * Delete lines **{first}** to **{last}** (inclusive) from buffer **{buf}**. - * If **{last}** is omitted then delete line **{first}** only. - * On success 0 is returned, on failure 1 is returned. - * - * This function works only for loaded buffers. First call - * `bufload()` if needed. - * - * For the use of **{buf}**, see `bufname()` above. - * - * **{first}** and **{last}** are used like with `getline()`. Note that - * when using `line()` this refers to the current buffer. Use "$" - * to refer to the last line in buffer **{buf}**. - * - * Can also be used as a `method`: - * - * GetBuffer()->deletebufline(1) - */ -export function deletebufline( - denops: Denops, - buf: unknown, - first: unknown, - last?: unknown, -): Promise; -export function deletebufline( - denops: Denops, - ...args: unknown[] -): Promise { - return denops.call("deletebufline", ...args); -} - /** * Returns `TRUE` when autocommands are being executed and the * FileType event has been triggered at least once. Can be used diff --git a/denops_std/function/buffer.ts b/denops_std/function/buffer.ts index 8bd80d31..8cb5edcc 100644 --- a/denops_std/function/buffer.ts +++ b/denops_std/function/buffer.ts @@ -49,6 +49,41 @@ export interface GetBufInfoDictArg { bufmodified?: boolean; } +/** + * Like `append()` but append the text in buffer **{buf}**. + * + * This function works only for loaded buffers. First call + * `bufload()` if needed. + * + * For the use of **{buf}**, see `bufname()`. + * + * **{lnum}** is the line number to append below. Note that using + * `line()` would use the current buffer, not the one appending + * to. Use "$" to append at the end of the buffer. Other string + * values are not supported. + * + * On success 0 is returned, on failure 1 is returned. + * In `Vim9` script an error is given for an invalid **{lnum}**. + * + * If **{buf}** is not a valid buffer or **{lnum}** is not valid, an + * error message is given. Example: + * + * :let failed = appendbufline(13, 0, "# THE START") + * + * Can also be used as a `method` after a List, the base is + * passed as the second argument: + * + * mylist->appendbufline(buf, lnum) + */ +export async function appendbufline( + denops: Denops, + buf: BufNameArg, + lnum: BufLnumArg, + text: string | string[], +): Promise { + return await denops.call("appendbufline", buf, lnum, text) as number; +} + /** * Add a buffer to the buffer list with name **{name}** (must be a * String). @@ -295,6 +330,33 @@ export async function bufwinnr( return await denops.call("bufwinnr", buf) as number; } +/** + * Delete lines **{first}** to **{last}** (inclusive) from buffer **{buf}**. + * If **{last}** is omitted then delete line **{first}** only. + * On success 0 is returned, on failure 1 is returned. + * + * This function works only for loaded buffers. First call + * `bufload()` if needed. + * + * For the use of **{buf}**, see `bufname()` above. + * + * **{first}** and **{last}** are used like with `getline()`. Note that + * when using `line()` this refers to the current buffer. Use "$" + * to refer to the last line in buffer **{buf}**. + * + * Can also be used as a `method`: + * + * GetBuffer()->deletebufline(1) + */ +export async function deletebufline( + denops: Denops, + buf: BufNameArg, + first: BufLnumArg, + last?: BufLnumArg, +): Promise { + return await denops.call("deletebufline", buf, first, last) as number; +} + /** * Get information about buffers as a List of Dictionaries. *