Skip to content

Commit 0953e83

Browse files
committed
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)
1 parent b830190 commit 0953e83

File tree

11 files changed

+62
-7
lines changed

11 files changed

+62
-7
lines changed

src/option.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7801,7 +7801,10 @@ set_bool_option(opt_idx, varp, value, opt_flags)
78017801
else if ((int *)varp == &curwin->w_p_scb)
78027802
{
78037803
if (curwin->w_p_scb)
7804+
{
78047805
do_check_scrollbind(FALSE);
7806+
curwin->w_scbind_pos = curwin->w_topline;
7807+
}
78057808
}
78067809
#endif
78077810

src/testdir/Make_amiga.mak

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
3333
test76.out test77.out test78.out test79.out test80.out \
3434
test81.out test82.out test83.out test84.out test88.out \
3535
test89.out test90.out test91.out test92.out test93.out \
36-
test94.out test95.out test96.out test97.out
36+
test94.out test95.out test96.out test97.out test98.out
3737

3838
.SUFFIXES: .in .out
3939

@@ -147,3 +147,4 @@ test94.out: test94.in
147147
test95.out: test95.in
148148
test96.out: test96.in
149149
test97.out: test97.in
150+
test98.out: test98.in

src/testdir/Make_dos.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
3232
test79.out test80.out test81.out test82.out test83.out \
3333
test84.out test85.out test86.out test87.out test88.out \
3434
test89.out test90.out test91.out test92.out test93.out \
35-
test94.out test95.out test96.out
35+
test94.out test95.out test96.out test98.out
3636

3737
SCRIPTS32 = test50.out test70.out
3838

src/testdir/Make_ming.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
5252
test79.out test80.out test81.out test82.out test83.out \
5353
test84.out test85.out test86.out test87.out test88.out \
5454
test89.out test90.out test91.out test92.out test93.out \
55-
test94.out test95.out test96.out
55+
test94.out test95.out test96.out test98.out
5656

5757
SCRIPTS32 = test50.out test70.out
5858

src/testdir/Make_os2.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
3434
test76.out test77.out test78.out test79.out test80.out \
3535
test81.out test82.out test83.out test84.out test88.out \
3636
test89.out test90.out test91.out test92.out test93.out \
37-
test94.out test95.out test96.out
37+
test94.out test95.out test96.out test98.out
3838

3939
.SUFFIXES: .in .out
4040

src/testdir/Make_vms.mms

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Authors: Zoltan Arpadffy, <[email protected]>
55
# Sandor Kopanyi, <[email protected]>
66
#
7-
# Last change: 2013 Jul 03
7+
# Last change: 2013 Jul 09
88
#
99
# This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
1010
# Edit the lines in the Configuration section below to select.
@@ -78,7 +78,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
7878
test77.out test78.out test79.out test80.out test81.out \
7979
test82.out test83.out test84.out test88.out test89.out \
8080
test90.out test91.out test92.out test93.out test94.out \
81-
test95.out test96.out test97.out
81+
test95.out test96.out test97.out test98.out
8282

8383
# Known problems:
8484
# Test 30: a problem around mac format - unknown reason

src/testdir/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
2929
test79.out test80.out test81.out test82.out test83.out \
3030
test84.out test85.out test86.out test87.out test88.out \
3131
test89.out test90.out test91.out test92.out test93.out \
32-
test94.out test95.out test96.out test97.out
32+
test94.out test95.out test96.out test97.out test98.out
3333

3434
SCRIPTS_GUI = test16.out
3535

src/testdir/test98.in

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Test for 'scrollbind' causing an unexpected scroll of one of the windows.
2+
STARTTEST
3+
:so small.vim
4+
:source test98a.in
5+
:let topLineLeft = line('w0')
6+
:wincmd p
7+
:let topLineRight = line('w0')
8+
:setl noscrollbind
9+
:wincmd p
10+
:setl noscrollbind
11+
:q!
12+
:%del _
13+
:call setline(1, 'Difference between the top lines (left - right): ' . string(topLineLeft - topLineRight))
14+
:w! test.out
15+
:brewind
16+
ENDTEST
17+
18+
STARTTEST
19+
:qa!
20+
ENDTEST
21+

src/testdir/test98.ok

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Difference between the top lines (left - right): 0

src/testdir/test98a.in

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
" We don't want the status line to cause problems:
2+
set laststatus=0
3+
redraw!
4+
let g:totalLines = &lines * 20
5+
let middle = g:totalLines / 2
6+
wincmd n
7+
wincmd o
8+
for i in range(1, g:totalLines)
9+
call setline(i, 'LINE ' . i)
10+
endfor
11+
12+
exe string(middle)
13+
normal zt
14+
normal M
15+
16+
aboveleft vert new
17+
for i in range(1, g:totalLines)
18+
call setline(i, 'line ' . i)
19+
endfor
20+
exe string(middle)
21+
normal zt
22+
normal M
23+
setl scb
24+
25+
wincmd p
26+
27+
call feedkeys(":setl scb\n\<C-w>\<C-w>", 't')

0 commit comments

Comments
 (0)