aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-03-22 04:47:39 +0000
committerBlaž Hrastnik2021-03-22 04:53:36 +0000
commit5e6716c89c0909bc374e26bedbba703427f9aa26 (patch)
tree658163e26962c436d0406f8dcf0d5f900116efdc /helix-term/src/ui
parent698e4ddea46e9c94d537c8e4a6c69e7dc9ee1947 (diff)
Add tab_width and indent_unit config.
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/editor.rs4
1 files changed, 2 insertions, 2 deletions
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