Skip to content

Autoformat ignores tabsize preference #5012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
scottdarch opened this issue Jun 4, 2016 · 2 comments
Open

Autoformat ignores tabsize preference #5012

scottdarch opened this issue Jun 4, 2016 · 2 comments
Labels
Component: IDE user interface The Arduino IDE's user interface Type: Bug

Comments

@scottdarch
Copy link

I have editor.tabs.size=4 in my preferences.txt which works fine if I hit but the autoformatter (cmd+T on OSX) ignores this setting and uses 2 spaces instead.

Verified this bug on both 1.6.8 and 1.6.9

@facchinm facchinm added Type: Bug Component: IDE user interface The Arduino IDE's user interface labels Jun 6, 2016
@JAG0991
Copy link

JAG0991 commented Jun 10, 2016

I'm looking within 1.6.10. The Auto Format tool uses a different configuration file called formatter.conf. It will look for a user defined formatter.conf within the same directory as your preferences.txt before using the default that can be found in the arduino/lib/ folder. The default formatter recommends that you copy it to the same directory as your preferences.txt and then edit it. Inside the formatter.conf is "indent=spaces=2". Changing this to 4 should hopefully make the Auto Format indent size the same as your editor.tabs.size.

@jacob-jarick
Copy link

jacob-jarick commented Sep 23, 2016

JAG0991 set me on the correct path. I use tabs always and 8 spaces (dont hate).

All the information needed to customize your code formatting is here:
http://astyle.sourceforge.net/astyle.html#_indent=tab

Exit arduino.
Create formatter.conf in your arduino conf directory (same location as preferences.txt
Add: indent=tab=8 (or your preferred size) then save.
edit preferences.txt

set the following 2 lines:

editor.tabs.expand=false
editor.tabs.size=8

done.

really should be an option in the GUI but its no hassle to edit a few config files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: IDE user interface The Arduino IDE's user interface Type: Bug
Projects
None yet
Development

No branches or pull requests

4 participants