mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 22:38:16 +00:00
buf_attach: fix buffer updates with setline()
This commit is contained in:

committed by
Thomas Vigouroux

parent
f34eeba2d8
commit
34c0f7af04
@@ -6962,9 +6962,10 @@ void set_buffer_lines(buf_T *buf, linenr_T lnum_arg, bool append,
|
||||
|
||||
if (!append && lnum <= curbuf->b_ml.ml_line_count) {
|
||||
// Existing line, replace it.
|
||||
int old_len = (int)STRLEN(ml_get(lnum));
|
||||
if (u_savesub(lnum) == OK
|
||||
&& ml_replace(lnum, (char_u *)line, true) == OK) {
|
||||
changed_bytes(lnum, 0);
|
||||
inserted_bytes(lnum, 0, old_len, STRLEN(line));
|
||||
if (is_curbuf && lnum == curwin->w_cursor.lnum) {
|
||||
check_cursor_col();
|
||||
}
|
||||
|
Reference in New Issue
Block a user