aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
authorKirawi2021-06-05 03:49:19 +0000
committerGitHub2021-06-05 03:49:19 +0000
commitc17dcb8633550a4efde56ca5b4e2b00fbf9f45e1 (patch)
tree9ab71f76679c1735f275448768c091219e2d49c0 /helix-term/src/ui
parent5a344a3ae508f571ad5427e14ffad683213bf142 (diff)
Fixing Multiple Panics (#121)
* init * wip * wip
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/editor.rs2
-rw-r--r--helix-term/src/ui/prompt.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index f474cb36..6c39088e 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -341,7 +341,7 @@ impl EditorView {
let info: Style = theme.get("info");
let hint: Style = theme.get("hint");
- for (i, line) in (view.first_line..last_line).enumerate() {
+ for (i, line) in (view.first_line..=last_line).enumerate() {
use helix_core::diagnostic::Severity;
if let Some(diagnostic) = doc.diagnostics.iter().find(|d| d.line == line) {
surface.set_stringn(
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs
index 1f424878..cdf303b8 100644
--- a/helix-term/src/ui/prompt.rs
+++ b/helix-term/src/ui/prompt.rs
@@ -114,7 +114,7 @@ impl Prompt {
let selected_color = theme.get("ui.menu.selected");
// completion
- let max_col = area.width / BASE_WIDTH;
+ let max_col = std::cmp::max(1, area.width / BASE_WIDTH);
let height = ((self.completion.len() as u16 + max_col - 1) / max_col);
let completion_area = Rect::new(
area.x,