@@ -63,6 +63,23 @@ func SetBufferLines(buffer Buffer, start int, end int, strict bool, replacement
63
63
name (nvim_buf_set_lines )
64
64
}
65
65
66
+ // SetBufferText sets or replaces a range in the buffer.
67
+ //
68
+ // This is recommended over SetBufferLines when only modifying parts of a
69
+ // line, as extmarks will be preserved on non-modified parts of the touched
70
+ // lines.
71
+ //
72
+ // Indexing is zero-based and end-exclusive.
73
+ //
74
+ // To insert text at a given index, set `start` and `end` ranges to the same
75
+ // index. To delete a range, set `replacement` to an array containing
76
+ // an empty string, or simply an empty array.
77
+ //
78
+ // Prefer SetBufferLines when adding or deleting entire lines only.
79
+ func SetBufferText (buffer Buffer , startRow , startCol , endRow , endCol int , replacement [][]byte ) {
80
+ name (nvim_buf_set_text )
81
+ }
82
+
66
83
// BufferOffset returns the byte offset for a line.
67
84
//
68
85
// Line 1 (index=0) has offset 0. UTF-8 bytes are counted. EOL is one byte.
@@ -690,6 +707,18 @@ func SetOption(name string, value interface{}) {
690
707
name (nvim_set_option )
691
708
}
692
709
710
+ // Echo echo a message.
711
+ //
712
+ // The chunks is a list of [text, hl_group] arrays, each representing a
713
+ // text chunk with specified highlight. hl_group element can be omitted for no highlight.
714
+ //
715
+ // If history is true, add to |message-history|.
716
+ //
717
+ // The opts arg is optional parameters. Reserved for future use.
718
+ func Echo (chunks []EchoChunk , history bool , opts map [string ]interface {}) {
719
+ name (nvim_echo )
720
+ }
721
+
693
722
// WriteOut writes a message to vim output buffer. The string is split and
694
723
// flushed after each newline. Incomplete lines are kept for writing later.
695
724
func WriteOut (str string ) {
0 commit comments