aboutsummaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
authorAnshul Dalal2023-08-08 00:13:10 +0000
committerGitHub2023-08-08 00:13:10 +0000
commitc7e9e94f007e04836d134cd3e53f71c38b7ba1ec (patch)
tree93aa3f5f1d20501bb705e092d4220a2bc81debbb /helix-view
parent7cda5b85920f875052438791f01246a408ee490e (diff)
Skip rendering gutters when gutter width exceeds view width (#7821)
Diffstat (limited to 'helix-view')
-rw-r--r--helix-view/src/view.rs10
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
+ }
}
//