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
bugfix: auto indentation after suggestion confirm #612
Conversation
|
I wonder if this will be problematic in other cases. You may not always want it to auto indent. e.g. you writing coffee someFunction: ->
someOther| # completes `someOtherFunction`In this case, it would autoindent to be a child of the function which could be really really annoying. |
Looking at the gif, the intention was to make auto completing react the same as actually typing the characters. That's probably always a good behavior. However the fix looks a bit like a band-aid, or a minimum change solution. It looks like the underlying issue is that not everything that listen for a key press get notified after autocomplete. The one apparent here is the logic that deal with increaseIndentPattern and decreaseIndentPattern |
|
I stepped through the code and noticed there are some difference within calling editor.insertText (the one that atom calls when you manually type a char) vs calling directly selection.insertText (the one that autocomplete-plus use on suggestion confirm). The editor.insertText function create an hash of options and pass it to the selection.insertText function. By calling selection.insertText directly without options we miss the auto indentation functionality. My last commit fix this, by passing the same indentation options that atom use. Now the behaviour is exactly the same as when you manually type characters.
|
|
Bump. I think is easy to review |
|
Rebased on current master. |
|
Yeah, this makes a lot of sense; great suggestion, @fruggiero. |
bugfix: auto indentation after suggestion confirm


Added an instruction to trigger the auto indentation after a suggestion is confirmed.
(It is a bugfix for this issue)