From 5e6716c89c0909bc374e26bedbba703427f9aa26 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Mon, 22 Mar 2021 13:47:39 +0900 Subject: Add tab_width and indent_unit config. --- helix-term/src/ui/editor.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'helix-term/src/ui/editor.rs') diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 3ee9d446..c48dc97e 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -6,7 +6,6 @@ use crate::{ }; use helix_core::{ - indent::TAB_WIDTH, syntax::{self, HighlightEvent}, Position, Range, }; @@ -106,6 +105,7 @@ impl EditorView { let mut spans = Vec::new(); let mut visual_x = 0; let mut line = 0u16; + let tab_width = view.doc.tab_width(); 'outer: for event in highlights { match event.unwrap() { @@ -152,7 +152,7 @@ impl EditorView { break 'outer; } } else if grapheme == "\t" { - visual_x += (TAB_WIDTH as u16); + visual_x += (tab_width as u16); } else { if visual_x >= viewport.width { // if we're offscreen just keep going until we hit a new line -- cgit v1.2.3-70-g09d2