diff options
-rw-r--r-- | src/nvim/testdir/test_tabpage.vim | 15 | ||||
-rw-r--r-- | src/nvim/window.c | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_tabpage.vim b/src/nvim/testdir/test_tabpage.vim index b97aa409d8..c20c798c49 100644 --- a/src/nvim/testdir/test_tabpage.vim +++ b/src/nvim/testdir/test_tabpage.vim @@ -846,4 +846,19 @@ func Test_lastused_tabpage() tabonly! endfunc +" this was giving ml_get errors +func Test_tabpage_last_line() + enew + call setline(1, repeat(['a'], &lines + 5)) + $ + tabnew + call setline(1, repeat(['b'], &lines + 20)) + $ + tabNext + call assert_equal('a', getline('.')) + + bwipe! + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/nvim/window.c b/src/nvim/window.c index 6a8d1cf740..38b7326363 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -4813,7 +4813,7 @@ static void win_enter_ext(win_T *const wp, const int flags) // Might need to scroll the old window before switching, e.g., when the // cursor was moved. - if (*p_spk == 'c') { + if (*p_spk == 'c' && !curwin_invalid) { update_topline(curwin); } |