aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/editor.rs
diff options
context:
space:
mode:
authorKirawi2021-08-09 06:46:58 +0000
committerGitHub2021-08-09 06:46:58 +0000
commit815ee9e334da0b973510e1b956eb75fe437038da (patch)
tree0ab1b21f817eb21c64387ff7acc61bdc9a9caaba /helix-term/src/ui/editor.rs
parentb5223618ed45cb6c67956795548f0963d570a5b2 (diff)
fix small terminal size panic with info popup (#563)
* fix small terminal size panic with info popup * remove unused enumerator * fix subtraction overflow panic
Diffstat (limited to 'helix-term/src/ui/editor.rs')
-rw-r--r--helix-term/src/ui/editor.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index 496edf42..ffe755e6 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -699,7 +699,8 @@ impl Component for EditorView {
match event {
Event::Resize(width, height) => {
// HAXX: offset the render area height by 1 to account for prompt/commandline
- cx.editor.resize(Rect::new(0, 0, width, height - 1));
+ cx.editor
+ .resize(Rect::new(0, 0, width, height.saturating_sub(1)));
EventResult::Consumed(None)
}
Event::Key(key) => {