diff src/normal.c @ 30833:e3d5781c7ec6 v9.0.0751

patch 9.0.0751: 'scrolloff' does not work well with 'smoothscroll' Commit: https://github.com/vim/vim/commit/c9121f798f49fa71e814912cb186d89c164090c3 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Oct 14 20:09:04 2022 +0100 patch 9.0.0751: 'scrolloff' does not work well with 'smoothscroll' Problem: 'scrolloff' does not work well with 'smoothscroll'. Solution: Make positioning the cursor a bit better. Rename functions.
author Bram Moolenaar <Bram@vim.org>
date Fri, 14 Oct 2022 21:15:03 +0200
parents c7983f593fa7
children 33ca088dbd3e
line wrap: on
line diff
--- a/src/normal.c
+++ b/src/normal.c
@@ -2266,7 +2266,7 @@ find_decl(
     static int
 nv_screengo(oparg_T *oap, int dir, long dist)
 {
-    int		linelen = linetabsize(ml_get_curline());
+    int		linelen = linetabsize_str(ml_get_curline());
     int		retval = OK;
     int		atend = FALSE;
     int		n;
@@ -2343,7 +2343,7 @@ nv_screengo(oparg_T *oap, int dir, long 
 		}
 		--curwin->w_cursor.lnum;
 
-		linelen = linetabsize(ml_get_curline());
+		linelen = linetabsize_str(ml_get_curline());
 		if (linelen > width1)
 		    curwin->w_curswant += (((linelen - width1 - 1) / width2)
 								+ 1) * width2;
@@ -2383,7 +2383,7 @@ nv_screengo(oparg_T *oap, int dir, long 
 		// clipped to column 0.
 		if (curwin->w_curswant >= width1)
 		    curwin->w_curswant -= width2;
-		linelen = linetabsize(ml_get_curline());
+		linelen = linetabsize_str(ml_get_curline());
 	    }
 	}
       }
@@ -6005,7 +6005,7 @@ nv_g_cmd(cmdarg_T *cap)
 	{
 	    oap->motion_type = MCHAR;
 	    oap->inclusive = FALSE;
-	    i = linetabsize(ml_get_curline());
+	    i = linetabsize_str(ml_get_curline());
 	    if (cap->count0 > 0 && cap->count0 <= 100)
 		coladvance((colnr_T)(i * cap->count0 / 100));
 	    else