Anthony Smith
7 posts
Mwahahaha
Indent Settings
Is there a way to customize the tab or autoindent sizing or are settings for that in the works?
Allen Webster
473 posts / 4 projects
Heyo
Indent Settings
There is no such setting if you are talking about the virtual whitespace system, but I have been wanting to add that so if that's what you mean I'll try to bump it up the todo list.

If you mean the indenter for the actual text and you have access to the customization code, the in 4coder_auto_indent.cpp you will see "#define DEF_TAB_WIDTH 4" on line 23. By setting that you can adjust how many spaces are given to an indentation. There is also DEFAULT_INDENT_FLAGS you can set that to any of the options listed here: Indent Flag Docs.
Anthony Smith
7 posts
Mwahahaha
Indent Settings
Edited by Anthony Smith on
Mr4thDimention
There is no such setting if you are talking about the virtual whitespace system, but I have been wanting to add that so if that's what you mean I'll try to bump it up the todo list.

Yeah, that's what I was talking about. It would be awesome if it was something that we could set programmatically at runtime instead of at compile time.

Mr4thDimention
If you mean the indenter for the actual text and you have access to the customization code, the in 4coder_auto_indent.cpp you will see "#define DEF_TAB_WIDTH 4" on line 23. By setting that you can adjust how many spaces are given to an indentation. There is also DEFAULT_INDENT_FLAGS you can set that to any of the options listed here: Indent Flag Docs.

Great! Now I know how that works... Does 4coder default to using spaces instead of tabs for the autoindent?
Allen Webster
473 posts / 4 projects
Heyo
Indent Settings
Yeah I want to build out the code flowing stuff some more, the current version still has some rough edges. I plan to work on it once Unicode support is good.

Yes 4coder uses space by default.
Anthony Smith
7 posts
Mwahahaha
Indent Settings
Mr4thDimention
Yeah I want to build out the code flowing stuff some more, the current version still has some rough edges. I plan to work on it once Unicode support is good.

Alright. Are settings that will allow us to specify how we want some things autoindented or not autoindented planned as well?
Allen Webster
473 posts / 4 projects
Heyo
Indent Settings
Yes the plan is to make the indentation rule pretty flexible, perhaps on par with emacs' own indentation customizations.
Andras Koczka
5 posts
Indent Settings
Hi Allen,

I tried to set DEF_TAB_WIDTH to 2 (on version 4.0.20) but everything still looks the same in the editor (4 wide indents), also some of the closing braces are off to the right by 2, but that is noticeable only if you check it with another editor or diff the files, in 4coder it is still rendered as before.

I would like to use 4coder for writing the Windows platform layer for my project, but I use 2 space indentation in all my code.

Thanks,
Andras

Allen Webster
473 posts / 4 projects
Heyo
Indent Settings
That sounds like you've got the "code wrapping" which automatically displays the code as if it had a 4 wide indent even if it has a 2 wide indent in the actual text. You can turn off code wrapping in config.4coder, then you will see the text exactly the way it is. If it still does 4 wide indents in the actual text let me know because that's definitely a bug then.
Andras Koczka
5 posts
Indent Settings
Edited by Andras Koczka on
I have set enable_code_wrapping to false and DEF_TAB_WIDTH to 2, but it still uses the 4 wide indent, also now the ending brace bug is also visible:

void hi() {
____printf("hi");
__}

It indents lines automatically when I enter ) or ;
I really like the code wrapping feature by the way, so it would be nice if it could work with 2 width tabs as well, actually I like it so much that I would rather switch to use 4 width tabs than not using that feature :)

Also, not related to this, but the automatically_save_changes_on_build only works for me when I use alt-m, but it does not work if I use my project.4coder setting:
fkey_command_win[1] = {"build.bat", "*compilation*", true};

Which kinda make sense, but is there a way to force saving here as well?
Allen Webster
473 posts / 4 projects
Heyo
Indent Settings
Huh yep that's a bug. I usually ignore the text indenting system these days since I just use code wrapping. I'll dig into it and figure out what's going on. Can you email me with your customization code and a sample code file that it indents incorrectly for you? That often makes these things go more quickly. Email me at [email protected].

The current code wrapping engine is mostly a proof of concept but the way it turned out customization is almost impossible. The new buffer engine in 4.1.X will feature fully C-customizable wrapping and indenting in the code wrapping feature.

Yes you can make your project commands save changes too. You just have to add an extra true to the command:
 1 fkey_command_win[1] = {"build.bat", "*compilation*", true, true}; 
Andras Koczka
5 posts
Indent Settings
I have sent the details.
Also the autosaving now works perfectly, thanks a lot :)