From 361d3e5fa04b49472d32a7d272f0375aff7f7672 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Mon, 24 Jul 2023 10:29:56 -0400 Subject: [PATCH] feat: add NoTabConversion const for disabling tab-to-space conversion --- set.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/set.go b/set.go index 2240b908..62a48eea 100644 --- a/set.go +++ b/set.go @@ -511,11 +511,15 @@ func (s Style) MaxHeight(n int) Style { return o } +// NoTabConversion can be passed to Style.TabWidth to disable the replacement +// of tabs with spaces at render time. +const NoTabConversion = -1 + // TabWidth sets the number of spaces that a tab (/t) should be rendered as. // When set to 0, tabs will be removed. To disable the replacement of tabs with -// spaces entirely, set this to -1. +// spaces entirely, set this to [NoTabConversion]. // -// By default, tabs will be removed and replaced with 4 spaces. +// By default, tabs will be replaced with 4 spaces. func (s Style) TabWidth(n int) Style { if n <= -1 { n = -1