From 053544d740ba24d454b9f7c91254a7457c31876f Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 1 May 2017 21:32:38 +0100 Subject: [PATCH] Disable horizontal scrolling when running a WrapHighlighter --- src/highlighters.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/highlighters.cc b/src/highlighters.cc index db9b7fda..2d4c3e96 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -736,6 +736,10 @@ struct WrapHighlighter : Highlighter return LineCount{(int)(len / column)}; }; + // Disable vertical scrolling when using a WrapHighlighter + setup.cursor_pos.column += setup.window_pos.column; + setup.window_pos.column = 0; + const LineCount win_height = context.window().dimensions().line; LineCount win_line = 0; for (auto buf_line = setup.window_pos.line; @@ -784,7 +788,7 @@ struct WrapHighlighter : Highlighter } } - static HighlighterAndId create(HighlighterParameters params) + static HighlighterAndId create(HighlighterParameters params) { if (params.size() != 0) throw runtime_error("wrong parameter count");