aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/move.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-11-22 23:12:30 +0100
committerJustin M. Keyes <justinkz@gmail.com>2017-11-22 23:12:30 +0100
commit8c959be51104fbf2aa01aa09f82df6cec515770c (patch)
tree045eab5e6aa1819c1ab13fcf1967c4a59cb82870 /src/nvim/move.c
parenta4f6cec7a31ff8dbfa089b9e22227afbeb951e9b (diff)
parentfe2546c81a8a7c0be5bbf0737d1169f6cd49bba0 (diff)
downloadrneovim-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.c10
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;