diff options
author | Ibby <33922797+SleepySwords@users.noreply.github.com> | 2023-03-19 18:32:44 +1100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2023-05-22 13:49:42 +0200 |
commit | 0e1f3b5acf74e82ea778f3c0871a804a9ae89d4e (patch) | |
tree | 3293bdfa570ae4d325ed6e8051bb6db5bb70ca8e /src/nvim/edit.c | |
parent | a38d7f99845d6ef566b2885737b892c660749d5e (diff) | |
download | rneovim-0e1f3b5acf74e82ea778f3c0871a804a9ae89d4e.tar.gz rneovim-0e1f3b5acf74e82ea778f3c0871a804a9ae89d4e.tar.bz2 rneovim-0e1f3b5acf74e82ea778f3c0871a804a9ae89d4e.zip |
vim-patch:9.0.0130: cursor position wrong when inserting around virtual text
Problem: Cursor position wrong when inserting around virtual text.
Solution: Update the cursor position properly.
https://github.com/vim/vim/commit/1f4ee19eefecd8f70b7cbe8ee9db8ace6352e23e
Co-authored-by: tom-anders <13141438+tom-anders@users.noreply.github.com>
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r-- | src/nvim/edit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index e3321a8b99..a25387f5a6 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -232,7 +232,7 @@ static void insert_enter(InsertState *s) stop_insert_mode = false; // need to position cursor again when on a TAB - if (gchar_cursor() == TAB) { + if (gchar_cursor() == TAB || curbuf->b_virt_text_inline > 0) { curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL); } @@ -3471,7 +3471,7 @@ static bool ins_esc(long *count, int cmdchar, bool nomove) State = MODE_NORMAL; may_trigger_modechanged(); // need to position cursor again when on a TAB - if (gchar_cursor() == TAB) { + if (gchar_cursor() == TAB || curbuf->b_virt_text_inline > 0) { curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL); } |