-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Apply editor.indent preference #6129
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
Conversation
tested the linux64 version. it now honors the true/false state of the 'editor.indent' setting for indenting. however, the unwanted behavior of adding a '}' for me when I type '{' is still there. Thank you for fixing this part of the issue. I have noted that the '{' '}' "autocomplete" behavior is no longer directly associated with indenting. It happens whether or not indenting is enabled. I shall add a new issue to use a 'preferences.txt' string to disable the unwanted (irritating) behavior, and reference these issues as part of it. |
related to this issue, I found the code that inserts the ending curly brace, see latest comment added to #6132 (with recommended change) |
@@ -148,6 +148,7 @@ private SketchTextArea createTextArea(RSyntaxDocument document) | |||
textArea.setMarginLineEnabled(false); | |||
textArea.setCodeFoldingEnabled(PreferencesData.getBoolean("editor.code_folding")); | |||
textArea.setAutoIndentEnabled(PreferencesData.getBoolean("editor.indent")); | |||
textArea.setCloseCurlyBraces(PreferencesData.getBoolean("editor.indent")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this be a separate preference? I personally dislike autocompletion, but I do want (same-level) auto indent (i.e. pressing enter preserves the indentation of the previous line, it should not increase indentation after a { for me).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, it should be moved to its own preference. I added it this way to check if the functionality was ok and provide a build with it
Thanks for the activity on this. Yes, I'm in total agreement with your earlier comments about making these two functionalities separate. Since the forum post from a couple of years ago (mentioned at the beginning) suggested that getting rid of auto-indent also got rid of auto-closing-brace, I had to weigh getting rid of something I want (auto-indent) against getting rid of something I really do not want (auto-closing-brace). Having the two settings instead (i.e. #6132) would be the best overall fix for this. So thanks for the mention. Also thanks for testing how it can be done. |
Here's a patch file that I have created based on a 'git clone' I did on the repository. It includes the change that fixes 'indent' (noted above) as well as adding 'editor.autocomplete' (issue #6132). I tested it and it works perfectly. It requires manually editing the local 'preferences.txt' to turn off the feature, but that's fine with me and probably everyone who wants this feature on by default. |
180a80e
to
b22c1bf
Compare
b22c1bf
to
6094788
Compare
✅ Build completed. Please test this code using one of the following: ⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-6129-BUILD-684-linux32.tar.xz ℹ️ The |
@bombasticbob Anyway, the editing-aids are just "auto indent" and "auto close braces" and IMHO is too early to think about an option to disable the aids altogether, I'd add such option later when/if more editing-aids are added. So here my proposal:
|
changing the text of the setting to 'auto_close_braces' is ok with me. I just want a way to control the behavior. I'm happy that the only question is what actual name to use [something I had already guessed might happen]. |
Solves #6128