changeset 33513:2232cbdb56e2 v9.0.2005

patch 9.0.2005: partially revert patch v9.0.1997 Commit: https://github.com/vim/vim/commit/b56cef0be08febc7e8edb8a87592f0a347c2793f Author: Christian Brabandt <cb@256bit.org> Date: Mon Oct 9 17:52:14 2023 +0200 patch 9.0.2005: partially revert patch v9.0.1997 Problem: partially revert patch v9.0.1997 Solution: add a comment, to make clear it's not used related: #13288 Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Mon, 09 Oct 2023 18:00:08 +0200
parents ce6568aa4da2
children 43c52ceae970
files src/move.c src/version.c
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/move.c
+++ b/src/move.c
@@ -1753,7 +1753,12 @@ scrolldown(
 	    ++row;
 	}
 	if (col > width2 && width2 > 0)
+	{
 	    row += col / width2;
+	    // even so col is not used anymore,
+	    // make sure it is correct, just in case
+	    col = col % width2;
+	}
 	if (row >= curwin->w_height)
 	{
 	    curwin->w_curswant = curwin->w_virtcol
@@ -1986,7 +1991,12 @@ adjust_skipcol(void)
 	++row;
     }
     if (col > width2)
+    {
 	row += col / width2;
+	// col may no longer be used, but make
+	// sure it is correct anyhow, just in case
+	col = col % width2;
+    }
     if (row >= curwin->w_height)
     {
 	if (curwin->w_skipcol == 0)
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2005,
+/**/
     2004,
 /**/
     2003,