about summary refs log tree commit diff stats
path: root/src/layout
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-15 21:41:51 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-15 21:41:51 +0100
commite0435743807c6f0c3b1d04cc89089c0528c9b33b (patch)
treea6ce721bc9bdd8f9ef2bdbf5d999748d4bcfe1e0 /src/layout
parent15815d7218927582538e48a3542b995031ff0b79 (diff)
downloadchawan-e0435743807c6f0c3b1d04cc89089c0528c9b33b.tar.gz
Fix tab width in pre
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/engine.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim
index 6a1e6e5c..a122b7fa 100644
--- a/src/layout/engine.nim
+++ b/src/layout/engine.nim
@@ -292,6 +292,8 @@ proc processWhitespace(state: var InlineState, c: char) =
   of WHITESPACE_PRE_LINE, WHITESPACE_PRE, WHITESPACE_PRE_WRAP:
     if c == '\n':
       state.ictx.flushLine(state.computed, state.maxwidth)
+    elif c == '\t':
+      state.ictx.whitespacenum = (state.ictx.whitespacenum div 8 + 1) * 8
     else:
       inc state.ictx.whitespacenum