File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -1770,4 +1770,30 @@ func Test_splitscroll_with_splits()
17701770 set splitscroll&
17711771endfunc
17721772
1773+ function Test_nosplitscroll_cmdwin_cursor_position ()
1774+ set nosplitscroll
1775+ call setline (1 , range (&lines ))
1776+
1777+ " No scroll when cursor is at near bottom of window and cusor position
1778+ " recompution (done by line('w0') in this test) happens while in cmdwin.
1779+ normal ! G
1780+ let firstline = line (' w0' )
1781+ autocmd CmdwinEnter * ++once autocmd WinEnter * ++once call line (' w0' )
1782+ execute " normal! q:\<C-w> q"
1783+ redraw !
1784+ call assert_equal (firstline, line (' w0' ))
1785+
1786+ " User script can change cursor position successfully while in cmdwin and it
1787+ " shouldn't be changed when closing cmdwin.
1788+ execute " normal! Gq:\<Cmd> call win_execute(winnr('#')->win_getid(), 'call cursor(1, 1)')\<CR>\<C-w> q"
1789+ call assert_equal (1 , line (' .' ))
1790+ call assert_equal (1 , col (' .' ))
1791+
1792+ execute " normal! Gq:\<Cmd> autocmd WinEnter * ++once call cursor(1, 1)\<CR>\<C-w> q"
1793+ call assert_equal (1 , line (' .' ))
1794+ call assert_equal (1 , col (' .' ))
1795+
1796+ % bwipeout !
1797+ set splitscroll&
1798+ endfunction
17731799" vim: shiftwidth = 2 sts = 2 expandtab
Original file line number Diff line number Diff line change @@ -703,6 +703,8 @@ static char *(features[]) =
703703
704704static int included_patches [] =
705705{ /* Add new patch number below this line */
706+ /**/
707+ 471 ,
706708/**/
707709 470 ,
708710/**/
You can’t perform that action at this time.
0 commit comments