changeset 32427:11bc7fa31c3b v9.0.1545

patch 9.0.1545: text not scrolled when cursor moved with "g0" and "h" Commit: https://github.com/vim/vim/commit/8667a5678f983ba899825b810ab849952d49bcb8 Author: Luuk van Baal <luukvbaal@gmail.com> Date: Fri May 12 15:47:25 2023 +0100 patch 9.0.1545: text not scrolled when cursor moved with "g0" and "h" Problem: Text not scrolled when cursor moved with "g0" and "h". Solution: Adjust w_skipcol when needed. (Luuk van Baal, closes https://github.com/vim/vim/issues/12387)
author Bram Moolenaar <Bram@vim.org>
date Fri, 12 May 2023 17:00:05 +0200
parents e8eff2701cbe
children 46c8cee129fc
files src/edit.c src/normal.c src/testdir/test_scroll_opt.vim src/version.c
diffstat 4 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/edit.c
+++ b/src/edit.c
@@ -2734,6 +2734,7 @@ oneleft(void)
 	}
 
 	curwin->w_set_curswant = TRUE;
+	adjust_skipcol();
 	return OK;
     }
 
--- a/src/normal.c
+++ b/src/normal.c
@@ -5762,6 +5762,7 @@ nv_g_home_m_cmd(cmdarg_T *cap)
 	curwin->w_valid &= ~VALID_WCOL;
     }
     curwin->w_set_curswant = TRUE;
+    adjust_skipcol();
 }
 
 /*
--- a/src/testdir/test_scroll_opt.vim
+++ b/src/testdir/test_scroll_opt.vim
@@ -419,6 +419,18 @@ func Test_smoothscroll_cursor_position()
   exe "normal \<C-Y>"
   call s:check_col_calc(1, 3, 41)
 
+  " Test "g0/g<Home>"
+  exe "normal gg\<C-E>"
+  norm $gkg0
+  call s:check_col_calc(1, 2, 21)
+
+  " Test moving the cursor behind the <<< display with 'virtualedit'
+  set virtualedit=all
+  exe "normal \<C-E>"
+  norm 3lgkh
+  call s:check_col_calc(3, 2, 23)
+  set virtualedit&
+
   normal gg3l
   exe "normal \<C-E>"
 
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1545,
+/**/
     1544,
 /**/
     1543,