diff options
Diffstat (limited to 'helix-view')
-rw-r--r-- | helix-view/src/view.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/helix-view/src/view.rs b/helix-view/src/view.rs index ee6fc127..e5e2641a 100644 --- a/helix-view/src/view.rs +++ b/helix-view/src/view.rs @@ -187,11 +187,17 @@ impl View { } pub fn gutter_offset(&self, doc: &Document) -> u16 { - self.gutters + let total_width = self + .gutters .layout .iter() .map(|gutter| gutter.width(self, doc) as u16) - .sum() + .sum(); + if total_width < self.area.width { + total_width + } else { + 0 + } } // |