Re: [code] about indentation

From: Mitchell <>
Date: Mon, 29 Oct 2012 13:57:19 -0400 (Eastern Daylight Time)

Hi John,

On Mon, 29 Oct 2012, John Ferrier wrote:

> Thank you, Mitchell. Actualy that's fine with me, and I feel sometime this maybe even better.
> Another thing I observed while I was testing the auto indentation was,
> for example, if I launed a fresh TA (blank window without any file
> loaded), and I noticed the indentation in this case was "2". I typed
> some lines like:
> int main()
> {
>    printf("1\n");
>    return 0;
> }
> There were 1 tab (= 2blanks) at the beginning of line 3 and 4,
> and finally I saved it as "".
> Because I had set the indentation for C/C++ as "4" in
> "~/.textadept/modules/cpp/post_init.lua", I expected the indentation
> shown on the status bar to be changed to "4" as well, but actually it
> was still "2". However, if I typed one more tab when I created that
> file, after saving it I saw on the status bar the indentation was
> updated to "4" as expected. If this was by design then I think it's
> actally better than what I expected, otherwise it is something else.

I cannot reproduce this. I put the following in my cpp/post_init.lua:

     function _M.cpp.set_buffer_properties()
       buffer.tab_width = 4

I opened a new instance of ta, typed your text (with indentation of
"Spaces: 2"), and saved the file as "". The lexer immediately
changed to "cpp" and my indentation settings also changed in the statusbar
to "Spaces: 4". I must be misunderstanding your report.


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Mon 29 Oct 2012 - 13:57:19 EDT

This archive was generated by hypermail 2.2.0 : Tue 30 Oct 2012 - 06:42:51 EDT