From 75e6b54ae247c27cf5d346386b3acd7c2be344dd Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 11 May 2017 09:23:20 +0100 Subject: [PATCH] Disable horizontal scroll offset support when wrapping --- src/highlighter.hh | 2 +- src/highlighters.cc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/highlighter.hh b/src/highlighter.hh index cbfeac733..f6159df62 100644 --- a/src/highlighter.hh +++ b/src/highlighter.hh @@ -46,7 +46,7 @@ struct DisplaySetup // Position of the cursor in the window DisplayCoord cursor_pos; // Offset of line and columns that must remain visible around cursor - const DisplayCoord scroll_offset; + DisplayCoord scroll_offset; }; struct Highlighter diff --git a/src/highlighters.cc b/src/highlighters.cc index 4c7140fed..4cc576c38 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -742,9 +742,10 @@ struct WrapHighlighter : Highlighter return count; }; - // Disable vertical scrolling when using a WrapHighlighter + // Disable horizontal scrolling when using a WrapHighlighter setup.cursor_pos.column += setup.window_pos.column; setup.window_pos.column = 0; + setup.scroll_offset.column = 0; const LineCount win_height = context.window().dimensions().line; LineCount win_line = 0;