diff --git a/src/highlighter.hh b/src/highlighter.hh index cbfeac73..f6159df6 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 4c7140fe..4cc576c3 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;