mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 05:28:33 +00:00
treesitter: filter updates on <CR>
This fixes an error when fo=ro, when hitting <CR> to insert a new comment line.
This commit is contained in:

committed by
Björn Linse

parent
aa98527ce7
commit
9a7f111db6
@@ -1676,9 +1676,16 @@ int open_line(
|
||||
truncate_spaces(saved_line);
|
||||
}
|
||||
ml_replace(curwin->w_cursor.lnum, saved_line, false);
|
||||
extmark_splice_cols(
|
||||
curbuf, (int)curwin->w_cursor.lnum,
|
||||
0, curwin->w_cursor.col, (int)STRLEN(saved_line), kExtmarkUndo);
|
||||
|
||||
int new_len = (int)STRLEN(saved_line);
|
||||
|
||||
// TODO(vigoux): maybe there is issues there with expandtabs ?
|
||||
if (new_len < curwin->w_cursor.col) {
|
||||
extmark_splice_cols(
|
||||
curbuf, (int)curwin->w_cursor.lnum,
|
||||
new_len, curwin->w_cursor.col - new_len, 0, kExtmarkUndo);
|
||||
}
|
||||
|
||||
saved_line = NULL;
|
||||
if (did_append) {
|
||||
changed_lines(curwin->w_cursor.lnum, curwin->w_cursor.col,
|
||||
|
Reference in New Issue
Block a user