import { nvim_buf_set_text } from "https://deno.land/x/denops_std@v6.5.0/function/nvim/mod.ts";
Sets (replaces) a range in the buffer
This is recommended over nvim_buf_set_lines()
when only modifying parts
of a line, as extmarks will be preserved on non-modified parts of the
touched lines.
Indexing is zero-based. Row indices are end-inclusive, and column indices are end-exclusive.
To insert text at a given (row, column)
location, use start_row = end_row = row
and start_col = end_col = col
. To delete the text in a
range, use replacement = {}
.
Prefer nvim_buf_set_lines()
if you are only adding or deleting entire
lines.
Parameters:
- {buffer} Buffer handle, or 0 for current buffer
- {start_row} First line index
- {start_col} Starting column (byte offset) on first line
- {end_row} Last line index, inclusive
- {end_col} Ending column (byte offset) on last line, exclusive
- {replacement} Array of lines to use as replacement
See also:
nvim_buf_set_lines()
Parameters
denops: Denops