Skip to content

IDE {} 'autocomplete' behavior in editor needs to be "disable-able" #6132

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

Closed
bombasticbob opened this issue Mar 27, 2017 · 7 comments
Closed

Comments

@bombasticbob
Copy link

In the Arduino 1.0.5 environment, which I've used for a long time, there is no 'autocomplete' behavior for things like adding a '}' 2 lines below where you are when you type '{' followed by a carriage return.

For fast-typists like me, and like this poster, it's extremely irritating to have a hard-coded "feature" like this, getting in the way all of the time. And not being able to turn it off is extremely frustrating.

A simple solution would be to include a new setting:

  editor.autocomplete=false

that would disable all such featues. That way, the editor would behave as it did in 1.0.5 without getting in the way, and for those who like these features, it could be "on by default".

ref issues #6128 and #6129

@bombasticbob
Copy link
Author

the problem seems to be in the editor class 'RSyntaxTextArea'

The key to solving this might be here:

https://github.com/bobbylight/RSyntaxTextArea/blob/master/src/main/java/org/fife/ui/rsyntaxtextarea/RSyntaxTextAreaEditorKit.java#L1495

the idea would be to override the necessary class functions and stop this from happening if the 'editor.autocomplete' (or similar) variable is 'false'.

@bombasticbob
Copy link
Author

looks like the correct link for Arduino is this one:

https://github.com/arduino/RSyntaxTextArea/blob/master/src/main/java/org/fife/ui/rsyntaxtextarea/RSyntaxTextAreaEditorKit.java#L1495

the actual code block for 'possiblyCloseCurlyBrace' is here:

https://github.com/arduino/RSyntaxTextArea/blob/master/src/main/java/org/fife/ui/rsyntaxtextarea/RSyntaxTextAreaEditorKit.java#L1561

A test for something like 'editor.autocomplete=false' could be performed in the 'if' statement on line 1575. This would solve EVERYTHING.

@matthijskooijman
Copy link
Collaborator

@bombasticbob, since the most recent Arduino version, the upstream version of RSyntaxTextArea is used again.

@facchinm, perhaps you could add a note to the https://github.com/arduino/RSyntaxTextArea repository description that it is no longer used as of 1.8.2?

@bombasticbob
Copy link
Author

the 'setCloseCurlyBraces' function is probably the right way to do it. thanks.

@bombasticbob
Copy link
Author

verified; see pull request #6155 (tested, works)

@per1234
Copy link
Collaborator

per1234 commented Jul 6, 2017

Fixed by #6129.

Many thanks to bombasticbob, facchinm, matthijskooijman, and cmaglie for making this happen!!!

@per1234 per1234 closed this as completed Jul 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants