diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2020-09-11 19:30:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-11 19:30:46 +0200 |
commit | 997147e4bbb6c427e0b811d9d02991976afa9785 (patch) | |
tree | 0af5cb8480394d08b0ed6b9754192497877cfe3f /src | |
parent | 7ba28b1aedcb88ef5643b32dc4a6bf92ac090fed (diff) | |
parent | a8f71676a199b6ffccedf7388d4104431144b158 (diff) | |
download | rneovim-997147e4bbb6c427e0b811d9d02991976afa9785.tar.gz rneovim-997147e4bbb6c427e0b811d9d02991976afa9785.tar.bz2 rneovim-997147e4bbb6c427e0b811d9d02991976afa9785.zip |
Merge pull request #12889 from vigoux/bytetrack-open-line
Fix invalid events with `o` `<CR>` and `autoindent`
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/buffer_updates.c | 3 | ||||
-rw-r--r-- | src/nvim/change.c | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/buffer_updates.c b/src/nvim/buffer_updates.c index 3435c5988c..fc671ad9e2 100644 --- a/src/nvim/buffer_updates.c +++ b/src/nvim/buffer_updates.c @@ -288,7 +288,8 @@ void buf_updates_send_splice( int old_row, colnr_T old_col, bcount_t old_byte, int new_row, colnr_T new_col, bcount_t new_byte) { - if (!buf_updates_active(buf)) { + if (!buf_updates_active(buf) + || (old_byte == 0 && new_byte == 0)) { return; } diff --git a/src/nvim/change.c b/src/nvim/change.c index 5e1ec616f6..b8bc08b747 100644 --- a/src/nvim/change.c +++ b/src/nvim/change.c @@ -1677,6 +1677,9 @@ 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); saved_line = NULL; if (did_append) { changed_lines(curwin->w_cursor.lnum, curwin->w_cursor.col, |