summaryrefslogtreecommitdiff
path: root/helix-view/src/tree.rs
diff options
context:
space:
mode:
authorDoug Kelkhoff2023-01-21 20:20:59 +0000
committerGitHub2023-01-21 20:20:59 +0000
commit2b58ff4d7cc09bc48bcdd79096110eeb578b509f (patch)
tree2da392671e918f9fc826389ab1da2812da9d19c7 /helix-view/src/tree.rs
parent8347139ff582341246975f047f04b4848f6e5af9 (diff)
Add configuration for min width of line-numbers gutter (#4724)
Diffstat (limited to 'helix-view/src/tree.rs')
-rw-r--r--helix-view/src/tree.rs42
1 files changed, 9 insertions, 33 deletions
diff --git a/helix-view/src/tree.rs b/helix-view/src/tree.rs
index 469e913d..5ec2773d 100644
--- a/helix-view/src/tree.rs
+++ b/helix-view/src/tree.rs
@@ -701,7 +701,7 @@ impl<'a> DoubleEndedIterator for Traverse<'a> {
#[cfg(test)]
mod test {
use super::*;
- use crate::editor::GutterType;
+ use crate::editor::GutterConfig;
use crate::DocumentId;
#[test]
@@ -712,34 +712,22 @@ mod test {
width: 180,
height: 80,
});
- let mut view = View::new(
- DocumentId::default(),
- vec![GutterType::Diagnostics, GutterType::LineNumbers],
- );
+ let mut view = View::new(DocumentId::default(), GutterConfig::default());
view.area = Rect::new(0, 0, 180, 80);
tree.insert(view);
let l0 = tree.focus;
- let view = View::new(
- DocumentId::default(),
- vec![GutterType::Diagnostics, GutterType::LineNumbers],
- );
+ let view = View::new(DocumentId::default(), GutterConfig::default());
tree.split(view, Layout::Vertical);
let r0 = tree.focus;
tree.focus = l0;
- let view = View::new(
- DocumentId::default(),
- vec![GutterType::Diagnostics, GutterType::LineNumbers],
- );
+ let view = View::new(DocumentId::default(), GutterConfig::default());
tree.split(view, Layout::Horizontal);
let l1 = tree.focus;
tree.focus = l0;
- let view = View::new(
- DocumentId::default(),
- vec![GutterType::Diagnostics, GutterType::LineNumbers],
- );
+ let view = View::new(DocumentId::default(), GutterConfig::default());
tree.split(view, Layout::Vertical);
let l2 = tree.focus;
@@ -781,40 +769,28 @@ mod test {
});
let doc_l0 = DocumentId::default();
- let mut view = View::new(
- doc_l0,
- vec![GutterType::Diagnostics, GutterType::LineNumbers],
- );
+ let mut view = View::new(doc_l0, GutterConfig::default());
view.area = Rect::new(0, 0, 180, 80);
tree.insert(view);
let l0 = tree.focus;
let doc_r0 = DocumentId::default();
- let view = View::new(
- doc_r0,
- vec![GutterType::Diagnostics, GutterType::LineNumbers],
- );
+ let view = View::new(doc_r0, GutterConfig::default());
tree.split(view, Layout::Vertical);
let r0 = tree.focus;
tree.focus = l0;
let doc_l1 = DocumentId::default();
- let view = View::new(
- doc_l1,
- vec![GutterType::Diagnostics, GutterType::LineNumbers],
- );
+ let view = View::new(doc_l1, GutterConfig::default());
tree.split(view, Layout::Horizontal);
let l1 = tree.focus;
tree.focus = l0;
let doc_l2 = DocumentId::default();
- let view = View::new(
- doc_l2,
- vec![GutterType::Diagnostics, GutterType::LineNumbers],
- );
+ let view = View::new(doc_l2, GutterConfig::default());
tree.split(view, Layout::Vertical);
let l2 = tree.focus;