patch 9.0.0482: "g0" moves to wrong location with virtual text "above"
Problem: "g0" moves to wrong location with virtual text "above".
Solution: Compensate for the extra columns. (closes #11141) Also fix "g$"
diff --git a/src/move.c b/src/move.c
index 4b823ba..2ef7a9c 100644
--- a/src/move.c
+++ b/src/move.c
@@ -470,19 +470,29 @@
return FALSE;
}
+/*
+ * Update w_curswant.
+ */
+ void
+update_curswant_force(void)
+{
+ validate_virtcol();
+ curwin->w_curswant = curwin->w_virtcol
+#ifdef FEAT_PROP_POPUP
+ - curwin->w_virtcol_first_char
+#endif
+ ;
+ curwin->w_set_curswant = FALSE;
+}
+
+/*
+ * Update w_curswant if w_set_curswant is set.
+ */
void
update_curswant(void)
{
if (curwin->w_set_curswant)
- {
- validate_virtcol();
- curwin->w_curswant = curwin->w_virtcol
-#ifdef FEAT_PROP_POPUP
- - curwin->w_virtcol_first_char
-#endif
- ;
- curwin->w_set_curswant = FALSE;
- }
+ update_curswant_force();
}
/*