From bdcfe308341edc47df628c0ff753f2cd39479273 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 22 May 2017 08:54:25 +0100 Subject: [PATCH] Fix scrolling when cursor is on a wrapped part of the last displayed line --- src/highlighters.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/highlighters.cc b/src/highlighters.cc index 2de9c6bb..51758b6b 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -820,7 +820,7 @@ struct WrapHighlighter : Highlighter win_line += wrap_count + 1; // scroll window to keep cursor visible, and update range as lines gets removed - while (buf_line < cursor.line and setup.cursor_pos.line >= win_height) + while (setup.window_pos.line < cursor.line and setup.cursor_pos.line >= win_height) { auto removed_lines = 1 + line_wrap_count(setup.window_pos.line++); setup.cursor_pos.line -= removed_lines;