diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 4710f833b..2d48c1fb6 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -213,8 +213,7 @@ impl EditorView { let gutter_width = view.gutter_offset(doc); if gutter_width > 0 { - let mut gutter_area = inner.with_width(gutter_width); - gutter_area.x -= gutter_width; + let gutter_area = inner.with_width(gutter_width).shift_left(gutter_width); Self::render_gutter( editor, diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 5054e79d5..a8ede13d6 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -710,7 +710,7 @@ pub struct NullspaceConfig { impl Default for NullspaceConfig { fn default() -> Self { Self { - enable: true, + enable: false, pattern: String::from("╲"), } } diff --git a/helix-view/src/graphics.rs b/helix-view/src/graphics.rs index a26823b97..a04394a0a 100644 --- a/helix-view/src/graphics.rs +++ b/helix-view/src/graphics.rs @@ -153,6 +153,22 @@ impl Rect { } } + // Returns a new Rect shifted left. + pub fn shift_left(self, shift: u16) -> Rect { + Rect { + x: self.x - shift, + ..self + } + } + + // Returns a new Rect shifted left. + pub fn shift_right(self, shift: u16) -> Rect { + Rect { + x: self.x + shift, + ..self + } + } + // Returns a new Rect with height reduced from the bottom. // This does _not_ change the `y` coordinate. pub fn clip_bottom(self, height: u16) -> Rect {