patch 9.0.1362: ml_get error when going to another tab
Problem: ml_get error when going to another tab. (Daniel J. Perry)
Solution: Do not call update_topline() if "curwin" is invalid.
(closes #11907)
diff --git a/src/testdir/test_tabpage.vim b/src/testdir/test_tabpage.vim
index e57a5dd..83d6123 100644
--- a/src/testdir/test_tabpage.vim
+++ b/src/testdir/test_tabpage.vim
@@ -872,4 +872,19 @@
call assert_equal(1, tabpagenr('$'))
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