fix: panicked at 'attempt to subtract with overflow'

helix-term/src/ui/editor.rs:275:29
This would happen when the window-size was to small to display the entire width and one would start jumping forwards with f<some_char> and the beginning of the highlighted area would end up outside of the window
pull/132/head
ahkrr 4 years ago committed by Blaž Hrastnik
parent 444cd0b068
commit c5c3ec07f4

@ -272,7 +272,7 @@ impl EditorView {
viewport.x + start.col as u16,
viewport.y + start.row as u16,
// text.line(view.first_line).len_chars() as u16 - start.col as u16,
viewport.width - start.col as u16,
viewport.width.saturating_sub(start.col as u16),
1,
),
selection_style,

Loading…
Cancel
Save