" Tests for window cmd (:wincmd, :split, :vsplit, :resize and etc...)
source check.vim
+source screendump.vim
func Test_window_cmd_ls0_with_split()
set ls=0
set splitscroll&
endfunc
+function Test_nosplitscroll_callback()
+ CheckScreendump
+ let lines =<< trim END
+ set nosplitscroll
+ call setline(1, range(&lines))
+ function WincmdCb(a, b)
+ split | wincmd p
+ endfunction
+ function TermCb(a, b)
+ close | split
+ endfunction
+ nnoremap t <cmd>call popup_create(term_start(&shell, { 'hidden': 1, 'exit_cb': 'TermCb' }), {})<CR>
+ nnoremap j <cmd>call job_start([&shell, &shellcmdflag, "echo"], { 'exit_cb': 'WincmdCb' })<CR>
+ END
+ call writefile(lines, 'XTestNosplitscrollCallback', 'D')
+ let buf = RunVimInTerminal('-S XTestNosplitscrollCallback', #{rows: 8})
+
+ call term_sendkeys(buf, "j")
+ call VerifyScreenDump(buf, 'Test_nosplitscroll_callback_1', {})
+
+ call term_sendkeys(buf, ":quit\<CR>Htexit\<CR>")
+ call VerifyScreenDump(buf, 'Test_nosplitscroll_callback_2', {})
+
+ call term_sendkeys(buf, ":set sb\<CR>:quit\<CR>Gj")
+ call VerifyScreenDump(buf, 'Test_nosplitscroll_callback_3', {})
+
+ call term_sendkeys(buf, ":quit\<CR>Gtexit\<CR>")
+ call VerifyScreenDump(buf, 'Test_nosplitscroll_callback_4', {})
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
win_T *wp;
linenr_T lnum;
- skip_update_topline = TRUE; // avoid scrolling in curs_rows()
+ skip_update_topline = TRUE; // avoid scrolling in curs_columns()
FOR_ALL_WINDOWS(wp)
{
// Skip when window height has not changed.
scroll_to_fraction(wp, wp->w_prev_height);
wp->w_cursor.lnum = lnum;
}
+ else if (wp == curwin)
+ wp->w_valid &= ~VALID_CROW;
invalidate_botline_win(wp);
validate_botline_win(wp);
}