aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/ui/editor.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index f9c5e55e..31a9bfc8 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -378,7 +378,8 @@ impl EditorView {
let (grapheme, width) = if grapheme == "\t" {
// make sure we display tab as appropriate amount of spaces
- (tab.as_str(), tab_width)
+ let visual_tab_width = tab_width - (visual_x as usize % tab_width);
+ (&tab[..visual_tab_width], visual_tab_width)
} else {
// Cow will prevent allocations if span contained in a single slice
// which should really be the majority case