@@ -49,6 +49,41 @@ export interface GetBufInfoDictArg {
49
49
bufmodified ?: boolean ;
50
50
}
51
51
52
+ /**
53
+ * Like `append()` but append the text in buffer **{buf}**.
54
+ *
55
+ * This function works only for loaded buffers. First call
56
+ * `bufload()` if needed.
57
+ *
58
+ * For the use of **{buf}**, see `bufname()`.
59
+ *
60
+ * **{lnum}** is the line number to append below. Note that using
61
+ * `line()` would use the current buffer, not the one appending
62
+ * to. Use "$" to append at the end of the buffer. Other string
63
+ * values are not supported.
64
+ *
65
+ * On success 0 is returned, on failure 1 is returned.
66
+ * In `Vim9` script an error is given for an invalid **{lnum}**.
67
+ *
68
+ * If **{buf}** is not a valid buffer or **{lnum}** is not valid, an
69
+ * error message is given. Example:
70
+ *
71
+ * :let failed = appendbufline(13, 0, "# THE START")
72
+ *
73
+ * Can also be used as a `method` after a List, the base is
74
+ * passed as the second argument:
75
+ *
76
+ * mylist->appendbufline(buf, lnum)
77
+ */
78
+ export async function appendbufline (
79
+ denops : Denops ,
80
+ buf : BufNameArg ,
81
+ lnum : BufLnumArg ,
82
+ text : string | string [ ] ,
83
+ ) : Promise < number > {
84
+ return await denops . call ( "appendbufline" , buf , lnum , text ) as number ;
85
+ }
86
+
52
87
/**
53
88
* Add a buffer to the buffer list with name **{name}** (must be a
54
89
* String).
@@ -295,6 +330,33 @@ export async function bufwinnr(
295
330
return await denops . call ( "bufwinnr" , buf ) as number ;
296
331
}
297
332
333
+ /**
334
+ * Delete lines **{first}** to **{last}** (inclusive) from buffer **{buf}**.
335
+ * If **{last}** is omitted then delete line **{first}** only.
336
+ * On success 0 is returned, on failure 1 is returned.
337
+ *
338
+ * This function works only for loaded buffers. First call
339
+ * `bufload()` if needed.
340
+ *
341
+ * For the use of **{buf}**, see `bufname()` above.
342
+ *
343
+ * **{first}** and **{last}** are used like with `getline()`. Note that
344
+ * when using `line()` this refers to the current buffer. Use "$"
345
+ * to refer to the last line in buffer **{buf}**.
346
+ *
347
+ * Can also be used as a `method`:
348
+ *
349
+ * GetBuffer()->deletebufline(1)
350
+ */
351
+ export async function deletebufline (
352
+ denops : Denops ,
353
+ buf : BufNameArg ,
354
+ first : BufLnumArg ,
355
+ last ?: BufLnumArg ,
356
+ ) : Promise < number > {
357
+ return await denops . call ( "deletebufline" , buf , first , last ) as number ;
358
+ }
359
+
298
360
/**
299
361
* Get information about buffers as a List of Dictionaries.
300
362
*
0 commit comments