Skip to content

Commit 5e422b1

Browse files
committed
fix(renderer): restore tab stops if hard tabs are enabled
When hard tabs are enabled, we optimize rendering by using actual tab characters instead of spaces. This requires us to set tab stops every 8 columns at the beginning of the rendering process. Fixes: #1614
1 parent 729f05c commit 5e422b1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

cursed_renderer.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,11 @@ func (s *cursedRenderer) flush(closing bool) error {
275275
}
276276
}
277277

278+
// Restore tab stops if we have tab optimizations enabled.
279+
if s.starting && s.hardTabs {
280+
_, _ = s.scr.WriteString(ansi.SetTabEvery8Columns)
281+
}
282+
278283
if !s.starting && !closing && s.lastView != nil && viewEquals(s.lastView, &view) && frameArea == s.cellbuf.Bounds() {
279284
// No changes, nothing to do.
280285
return nil

0 commit comments

Comments
 (0)