aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/move.c4
-rw-r--r--src/nvim/testdir/test_breakindent.vim2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c
index a6afdc27d9..1210a3365a 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -888,11 +888,11 @@ void curs_columns(
} else {
n = plines;
}
- if ((colnr_T)n >= wp->w_height_inner + wp->w_skipcol / width) {
+ if ((colnr_T)n >= wp->w_height_inner + wp->w_skipcol / width - so) {
extra += 2;
}
- if (extra == 3 || plines < so * 2) {
+ if (extra == 3 || plines <= so * 2) {
// not enough room for 'scrolloff', put cursor in the middle
n = wp->w_virtcol / width;
if (n > wp->w_height_inner / 2) {
diff --git a/src/nvim/testdir/test_breakindent.vim b/src/nvim/testdir/test_breakindent.vim
index a4c1f62a43..93982182d1 100644
--- a/src/nvim/testdir/test_breakindent.vim
+++ b/src/nvim/testdir/test_breakindent.vim
@@ -352,7 +352,7 @@ func Test_breakindent19_sbr_nextpage()
call s:compare_lines(expect, lines)
" Scroll down one screen line
setl scrolloff=5
- norm! 5gj
+ norm! 6gj
redraw!
let lines = s:screen_lines(1, 20)
let expect = [