# HG changeset patch # User Bram Moolenaar # Date 1373370299 -7200 # Node ID 7a6ce0c426fec6051523bb00e050b826fa664beb # Parent d61d9549c1e22eeaf15b53e8f44b552b8cc4fb2e updated for version 7.4a.005 Problem: Scroll binding causes unexpected scroll. Solution: Store the topline after updating scroll binding. Add a test. (Lech Lorens) diff --git a/src/option.c b/src/option.c --- a/src/option.c +++ b/src/option.c @@ -7801,7 +7801,10 @@ set_bool_option(opt_idx, varp, value, op else if ((int *)varp == &curwin->w_p_scb) { if (curwin->w_p_scb) + { do_check_scrollbind(FALSE); + curwin->w_scbind_pos = curwin->w_topline; + } } #endif diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak --- a/src/testdir/Make_amiga.mak +++ b/src/testdir/Make_amiga.mak @@ -33,7 +33,7 @@ SCRIPTS = test1.out test3.out test4.out test76.out test77.out test78.out test79.out test80.out \ test81.out test82.out test83.out test84.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ - test94.out test95.out test96.out test97.out + test94.out test95.out test96.out test97.out test98.out .SUFFIXES: .in .out @@ -147,3 +147,4 @@ test94.out: test94.in test95.out: test95.in test96.out: test96.in test97.out: test97.in +test98.out: test98.in diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak --- a/src/testdir/Make_dos.mak +++ b/src/testdir/Make_dos.mak @@ -32,7 +32,7 @@ SCRIPTS = test3.out test4.out test5.out test79.out test80.out test81.out test82.out test83.out \ test84.out test85.out test86.out test87.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ - test94.out test95.out test96.out + test94.out test95.out test96.out test98.out SCRIPTS32 = test50.out test70.out diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak --- a/src/testdir/Make_ming.mak +++ b/src/testdir/Make_ming.mak @@ -52,7 +52,7 @@ SCRIPTS = test3.out test4.out test5.out test79.out test80.out test81.out test82.out test83.out \ test84.out test85.out test86.out test87.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ - test94.out test95.out test96.out + test94.out test95.out test96.out test98.out SCRIPTS32 = test50.out test70.out diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak --- a/src/testdir/Make_os2.mak +++ b/src/testdir/Make_os2.mak @@ -34,7 +34,7 @@ SCRIPTS = test1.out test3.out test4.out test76.out test77.out test78.out test79.out test80.out \ test81.out test82.out test83.out test84.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ - test94.out test95.out test96.out + test94.out test95.out test96.out test98.out .SUFFIXES: .in .out diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms --- a/src/testdir/Make_vms.mms +++ b/src/testdir/Make_vms.mms @@ -4,7 +4,7 @@ # Authors: Zoltan Arpadffy, # Sandor Kopanyi, # -# Last change: 2013 Jul 03 +# Last change: 2013 Jul 09 # # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64. # Edit the lines in the Configuration section below to select. @@ -78,7 +78,7 @@ SCRIPT = test1.out test2.out test3.out test77.out test78.out test79.out test80.out test81.out \ test82.out test83.out test84.out test88.out test89.out \ test90.out test91.out test92.out test93.out test94.out \ - test95.out test96.out test97.out + test95.out test96.out test97.out test98.out # Known problems: # Test 30: a problem around mac format - unknown reason diff --git a/src/testdir/Makefile b/src/testdir/Makefile --- a/src/testdir/Makefile +++ b/src/testdir/Makefile @@ -29,7 +29,7 @@ SCRIPTS = test1.out test2.out test3.out test79.out test80.out test81.out test82.out test83.out \ test84.out test85.out test86.out test87.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ - test94.out test95.out test96.out test97.out + test94.out test95.out test96.out test97.out test98.out SCRIPTS_GUI = test16.out diff --git a/src/testdir/test98.in b/src/testdir/test98.in new file mode 100644 --- /dev/null +++ b/src/testdir/test98.in @@ -0,0 +1,21 @@ +Test for 'scrollbind' causing an unexpected scroll of one of the windows. +STARTTEST +:so small.vim +:source test98a.in +:let topLineLeft = line('w0') +:wincmd p +:let topLineRight = line('w0') +:setl noscrollbind +:wincmd p +:setl noscrollbind +:q! +:%del _ +:call setline(1, 'Difference between the top lines (left - right): ' . string(topLineLeft - topLineRight)) +:w! test.out +:brewind +ENDTEST + +STARTTEST +:qa! +ENDTEST + diff --git a/src/testdir/test98.ok b/src/testdir/test98.ok new file mode 100644 --- /dev/null +++ b/src/testdir/test98.ok @@ -0,0 +1,1 @@ +Difference between the top lines (left - right): 0 diff --git a/src/testdir/test98a.in b/src/testdir/test98a.in new file mode 100644 --- /dev/null +++ b/src/testdir/test98a.in @@ -0,0 +1,27 @@ +" We don't want the status line to cause problems: +set laststatus=0 +redraw! +let g:totalLines = &lines * 20 +let middle = g:totalLines / 2 +wincmd n +wincmd o +for i in range(1, g:totalLines) + call setline(i, 'LINE ' . i) +endfor + +exe string(middle) +normal zt +normal M + +aboveleft vert new +for i in range(1, g:totalLines) + call setline(i, 'line ' . i) +endfor +exe string(middle) +normal zt +normal M +setl scb + +wincmd p + +call feedkeys(":setl scb\n\\", 't') diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 5, +/**/ 4, /**/ 3,