patch 9.0.1428: cursor in wrong position when leaving insert mode
Problem: Cursor in wrong position when leaving insert mode.
Solution: Update the w_valid flags. Position the cursor also when not
redrawing. (closes #12137)
diff --git a/src/edit.c b/src/edit.c
index 212efae..84b6eef 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -3688,6 +3688,7 @@
else
{
--curwin->w_cursor.col;
+ curwin->w_valid &= ~(VALID_WCOL|VALID_VIRTCOL);
// Correct cursor for multi-byte character.
if (has_mbyte)
mb_adjust_cursor();