aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/move.c
diff options
context:
space:
mode:
authorKunMing Xie <qqzz014@gmail.com>2018-05-30 15:11:52 +0800
committerJustin M. Keyes <justinkz@gmail.com>2018-05-30 09:11:52 +0200
commit77a2eaf08bdc29f5ae6f4dc263b2a97b6cb749e8 (patch)
treeedb9d5218655b1f030b6c19ea4b1e56efd6b791e /src/nvim/move.c
parentf711b635133fea2a137b97caa199f68d3142ed4f (diff)
downloadrneovim-77a2eaf08bdc29f5ae6f4dc263b2a97b6cb749e8.tar.gz
rneovim-77a2eaf08bdc29f5ae6f4dc263b2a97b6cb749e8.tar.bz2
rneovim-77a2eaf08bdc29f5ae6f4dc263b2a97b6cb749e8.zip
vim-patch:8.0.0515: ml_get errors in silent Ex mode (#8452)
Problem: ml_get errors in silent Ex mode. (Dominique Pelle) Solution: Clear valid flags when setting the cursor. Set the topline when not in full screen mode. https://github.com/vim/vim/commit/d5d37537d1fa46fd468bd378af2006dd09840f38
Diffstat (limited to 'src/nvim/move.c')
-rw-r--r--src/nvim/move.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c
index cb13a9e207..41859a489f 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -132,11 +132,9 @@ void update_topline(void)
bool check_botline = false;
long save_so = p_so;
- if (!screen_valid(true))
- return;
-
- // If the window height is zero, just use the cursor line.
- if (curwin->w_height == 0) {
+ // If there is no valid screen and when the window height is zero just use
+ // the cursor line.
+ if (!screen_valid(true) || curwin->w_height == 0) {
curwin->w_topline = curwin->w_cursor.lnum;
curwin->w_botline = curwin->w_topline;
curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;
@@ -1979,6 +1977,7 @@ void halfpage(bool flag, linenr_T Prenum)
int n = curwin->w_p_scr <= curwin->w_height ? (int)curwin->w_p_scr
: curwin->w_height;
+ update_topline();
validate_botline();
int room = curwin->w_empty_rows + curwin->w_filler_rows;
if (flag) {