From: Luuk van Baal Date: Fri, 12 May 2023 14:47:25 +0000 (+0100) Subject: patch 9.0.1545: text not scrolled when cursor moved with "g0" and "h" X-Git-Tag: v9.0.1545 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8667a5678f983ba899825b810ab849952d49bcb8;p=thirdparty%2Fvim.git 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 #12387) --- diff --git a/src/edit.c b/src/edit.c index c23b0a8556..64edddce8d 100644 --- a/src/edit.c +++ b/src/edit.c @@ -2734,6 +2734,7 @@ oneleft(void) } curwin->w_set_curswant = TRUE; + adjust_skipcol(); return OK; } diff --git a/src/normal.c b/src/normal.c index 2f3d12a41b..07201341a8 100644 --- 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(); } /* diff --git a/src/testdir/test_scroll_opt.vim b/src/testdir/test_scroll_opt.vim index c12da9786b..0bdf6840b9 100644 --- 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 \" call s:check_col_calc(1, 3, 41) + " Test "g0/g" + exe "normal gg\" + norm $gkg0 + call s:check_col_calc(1, 2, 21) + + " Test moving the cursor behind the <<< display with 'virtualedit' + set virtualedit=all + exe "normal \" + norm 3lgkh + call s:check_col_calc(3, 2, 23) + set virtualedit& + normal gg3l exe "normal \" diff --git a/src/version.c b/src/version.c index 4f2b2a72be..f13f8e093e 100644 --- a/src/version.c +++ b/src/version.c @@ -695,6 +695,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1545, /**/ 1544, /**/