mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 15:38:33 +00:00
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.
1f4ee19eef
Co-authored-by: tom-anders <13141438+tom-anders@users.noreply.github.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user