emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: In go-ts-mode, tab-width 4 inserts two tabs instead of one


From: Pankaj Jangid
Subject: Re: In go-ts-mode, tab-width 4 inserts two tabs instead of one
Date: Tue, 26 Sep 2023 18:01:48 +0530
User-agent: Gnus/5.13 (Gnus v5.13)

"Augustin Chéneau (BTuin)" <btuin@mailo.com> writes:

> That's because tab-width only controls the appearance of a
> tabulation.

I actually want this only. That is, I want to control the appearance of
tabulation only.

> In go-ts-mode, the indentation offset is set by the variable
> go-ts-mode-indent-offset.  Since it is 8 by default and that you have
> set tab-width to 4, it inserts two tabs to keep the offset of 8.
>
> So you simply need to set go-ts-mode-indent-offset to 4 or directly to
> tab-width (with (setq go-ts-mode-indent-offset tab-width)).

Setting both, tab-width and go-ts-mode-indent-offset, to 4 results in
the desired behaviour. But I did not understand this.

The doc string of go-ts-mode-indent-offset says, "Number of spaces for
each indentation step". But when I set both to 4, it uses TAB (which I
want), and not SPACEes.

Is this variable explained in detail elsewhere?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]