Mercurial > vim
changeset 5157:7a6ce0c426fe v7.4a.005
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)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 09 Jul 2013 13:44:59 +0200 |
parents | d61d9549c1e2 |
children | 5c419eae3fca |
files | src/option.c src/testdir/Make_amiga.mak src/testdir/Make_dos.mak src/testdir/Make_ming.mak src/testdir/Make_os2.mak src/testdir/Make_vms.mms src/testdir/Makefile src/testdir/test98.in src/testdir/test98.ok src/testdir/test98a.in src/version.c |
diffstat | 11 files changed, 62 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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
--- 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
--- 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
--- 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
--- a/src/testdir/Make_vms.mms +++ b/src/testdir/Make_vms.mms @@ -4,7 +4,7 @@ # Authors: Zoltan Arpadffy, <arpadffy@polarhome.com> # Sandor Kopanyi, <sandor.kopanyi@mailbox.hu> # -# 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
--- 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
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 +
new file mode 100644 --- /dev/null +++ b/src/testdir/test98.ok @@ -0,0 +1,1 @@ +Difference between the top lines (left - right): 0
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\<C-w>\<C-w>", 't')