aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-11-16 06:02:48 +0000
committerBlaž Hrastnik2021-11-16 06:02:48 +0000
commit8db6fffe90514e38beaf60138c1a8fb8a83ef04c (patch)
tree49ff8e4e8dcea797188e41a03c8ff45fc140970c
parent335ed7fa6953ae95a9f8ff376b53228bcef80cfe (diff)
ui: Increase diagnostics sideline width to 100 max and wrap if needed
-rw-r--r--helix-term/src/ui/editor.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index bcd9f8f0..03cd0474 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -497,7 +497,7 @@ impl EditorView {
use tui::{
layout::Alignment,
text::Text,
- widgets::{Paragraph, Widget},
+ widgets::{Paragraph, Widget, Wrap},
};
let cursor = doc
@@ -529,8 +529,10 @@ impl EditorView {
lines.extend(text.lines);
}
- let paragraph = Paragraph::new(lines).alignment(Alignment::Right);
- let width = 80.min(viewport.width);
+ let paragraph = Paragraph::new(lines)
+ .alignment(Alignment::Right)
+ .wrap(Wrap { trim: true });
+ let width = 100.min(viewport.width);
let height = 15.min(viewport.height);
paragraph.render(
Rect::new(viewport.right() - width, viewport.y + 1, width, height),