diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-11-22 23:12:30 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-11-22 23:12:30 +0100 |
commit | 8c959be51104fbf2aa01aa09f82df6cec515770c (patch) | |
tree | 045eab5e6aa1819c1ab13fcf1967c4a59cb82870 /src/nvim/move.c | |
parent | a4f6cec7a31ff8dbfa089b9e22227afbeb951e9b (diff) | |
parent | fe2546c81a8a7c0be5bbf0737d1169f6cd49bba0 (diff) | |
download | rneovim-8c959be51104fbf2aa01aa09f82df6cec515770c.tar.gz rneovim-8c959be51104fbf2aa01aa09f82df6cec515770c.tar.bz2 rneovim-8c959be51104fbf2aa01aa09f82df6cec515770c.zip |
Merge #7593 'PVS static analysis fixes'
Diffstat (limited to 'src/nvim/move.c')
-rw-r--r-- | src/nvim/move.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c index 9693132846..134ffcd7dc 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -1989,9 +1989,8 @@ void halfpage(bool flag, linenr_T Prenum) while (n > 0 && curwin->w_botline <= curbuf->b_ml.ml_line_count) { if (curwin->w_topfill > 0) { i = 1; - if (--n < 0 && scrolled > 0) - break; - --curwin->w_topfill; + n--; + curwin->w_topfill--; } else { i = plines_nofill(curwin->w_topline); n -= i; @@ -2067,9 +2066,8 @@ void halfpage(bool flag, linenr_T Prenum) while (n > 0 && curwin->w_topline > 1) { if (curwin->w_topfill < diff_check_fill(curwin, curwin->w_topline)) { i = 1; - if (--n < 0 && scrolled > 0) - break; - ++curwin->w_topfill; + n--; + curwin->w_topfill++; } else { i = plines_nofill(curwin->w_topline - 1); n -= i; |