summaryrefslogtreecommitdiff
path: root/helix-core/src
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-03-04 02:01:33 +0000
committerBlaž Hrastnik2022-03-04 02:01:33 +0000
commitfd02d1bf8966754624c733790c20bb8431e1eb54 (patch)
treed0f4480f9190f8048d70acceca1711cc2e999a34 /helix-core/src
parent5f386fa355d2f3e95a890c2d63d95b05ddca23a4 (diff)
Fix tab rendering to use dynamic tab width
Each tab is just wide enough to round to the nearest tab stop. Refs #1243
Diffstat (limited to 'helix-core/src')
-rw-r--r--helix-core/src/position.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-core/src/position.rs b/helix-core/src/position.rs
index 17908d7a..ce37300a 100644
--- a/helix-core/src/position.rs
+++ b/helix-core/src/position.rs
@@ -83,7 +83,7 @@ pub fn visual_coords_at_pos(text: RopeSlice, pos: usize, tab_width: usize) -> Po
for grapheme in RopeGraphemes::new(text.slice(line_start..pos)) {
if grapheme == "\t" {
- col += tab_width;
+ col += tab_width - (col % tab_width);
} else {
let grapheme = Cow::from(grapheme);
col += grapheme_width(&grapheme);