mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.2495: text jumps up and down when moving the cursor
Problem: Text jumps up and down when moving the cursor in a small window with wrapping text and 'scrolloff' set. Solution: Adjust the computation of w_skipcol. (partly by Ghjuvan Lacambre, closes #7813)
This commit is contained in:
@@ -1125,10 +1125,10 @@ curs_columns(
|
|||||||
n = curwin->w_wrow + so;
|
n = curwin->w_wrow + so;
|
||||||
else
|
else
|
||||||
n = p_lines;
|
n = p_lines;
|
||||||
if ((colnr_T)n >= curwin->w_height + curwin->w_skipcol / width)
|
if ((colnr_T)n >= curwin->w_height + curwin->w_skipcol / width - so)
|
||||||
extra += 2;
|
extra += 2;
|
||||||
|
|
||||||
if (extra == 3 || p_lines < so * 2)
|
if (extra == 3 || p_lines <= so * 2)
|
||||||
{
|
{
|
||||||
// not enough room for 'scrolloff', put cursor in the middle
|
// not enough room for 'scrolloff', put cursor in the middle
|
||||||
n = curwin->w_virtcol / width;
|
n = curwin->w_virtcol / width;
|
||||||
|
@@ -634,7 +634,7 @@ func Test_breakindent19_sbr_nextpage()
|
|||||||
call s:compare_lines(expect, lines)
|
call s:compare_lines(expect, lines)
|
||||||
" Scroll down one screen line
|
" Scroll down one screen line
|
||||||
setl scrolloff=5
|
setl scrolloff=5
|
||||||
norm! 5gj
|
norm! 6gj
|
||||||
redraw!
|
redraw!
|
||||||
let lines = s:screen_lines(1, 20)
|
let lines = s:screen_lines(1, 20)
|
||||||
let expect = [
|
let expect = [
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2495,
|
||||||
/**/
|
/**/
|
||||||
2494,
|
2494,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user