Disable horizontal scroll offset support when wrapping

This commit is contained in:
Maxime Coste 2017-05-11 09:23:20 +01:00
parent 8fa7e67abc
commit 75e6b54ae2
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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;