autocomplete-plus
autocomplete-plus copied to clipboard
Using Enter two times for two autocomplete suggestions in a row adds new line in stylesheet files on second enter
Prerequisites
- [x] Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: http://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: http://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
When editing stylesheet files (.scss in particular) and using enter
to autocomplete two times in a row (to autocomplete a CSS property and autocomplete its value), the second enter adds a new line rather than autocompleting the value.
Steps to Reproduce
- With default plugin settings, begin writing a CSS property
- Use
enter
key to autocomplete first suggested property and see that it is autocompleted - Use
enter
key to autocomplete first suggested property value and see that a new line is added
Expected behavior: The use of the enter key should add the suggested autocomplete selection
Actual behavior: The use of the enter key works initially, but a consecutive use on a new autocomplete suggested adds a new line
Reproduces how often: 90% in normal mode, 10% in safe mode
Versions
Atom : 1.28.1
Electron: 2.0.4
Chrome : 61.0.3163.100
Node : 8.9.3
apm 1.19.0
npm 3.10.10
node 6.9.5 x64
atom 1.28.1
python 2.7.15
git 2.15.0
Mac OS High Sierra 10.13.5
Additional Information
Not using Emmet. I almost exclusively write SCSS files, but I have tested in CSS files. Only happened 10% of the time in safe mode. I believe it may be happening most frequently with SCSS files with nested and non-nested elements.
I get this too - drives me nuts. Any fix or workaround available?
Additional: it also does this is you start typing something, so in the example here if you started typing abs
it would still just put in a new line and not auto complete.
Thanks for the report - I was unable to reproduce on macOS 10.12.6 with Atom 1.32.1 in safe mode (tried it ~10 times in a row).
I believe it may be happening most frequently with SCSS files with nested and non-nested elements.
@tomanistor: can you share an minimal example file that I can test with?
I have the same problem on SCSS files with Atom 1.32.2 and macOS 10.14.1. I can reproduce the same way it's described in the first message.
@nicolashmln - do you also see the behavior much less in safe mode as described above? And does it happen with any SCSS files?
@rsese In normal mode it happens on every SCSS files. I can't reproduce in safe mode on the same SCSS files. Should it be an other plugin interfering?
@nicolashmln - yes if there's no problem in safe mode, then that likely means a community package or possibly something in your init script is causing the issue:
http://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
You can disable each community package one by one to try and pinpoint which is causing the problem for you.
I've just turned off all Community Packages and re-enabled each one. Turns out that busy-signal
was causing this for me, I have turned it off and it's no longer showing this behaviour. No idea what that package did anyway TBH!
Same for me, after disabling busy-signal
I don't have this behaviour anymore. Thanks @dannyuk1982 !
@dannyuk1982 I believe busy-signal
provides a progress indicator in the status bar for other packages to use.
No idea why it's doing that though. You might want to raise an issue on it's repo
Have done!
I can reproduce this in Safe Mode using Atom v1.34.0-nightly9, so this has nothing to do with a community package. In fact it's hard not to reproduce this, as it happens to me ~90% of the time:
idk if its gonna help somehow
sometimes "autocomplete-active" class isnt added to "atom-text-editor" after first enter press, so editor uses editor:newline instead of core:confirm
I've been having this same issue for years and is my only complaint about Atom!
I've tried editing the keymap to resolve this to no avail. What's most confusing is if I go back up to the css property a second time, choose the value with the keyboard and hit enter, the behavior is as expected (confirm's selection, not new line created)
Has anyone figured out the correct keymap entry to resolve this?
https://user-images.githubusercontent.com/5290498/127535837-01f0d2a9-f843-4ef4-ae57-823ee5dcd134.mov
It looks like @bergeg is right, the class is being removed too soon, or isn't being added again.
All the logic happens inside https://github.com/atom/autocomplete-plus/blob/master/lib/suggestion-list.js, it's hard to debug but someone might be able to figure this one out.
This issue was hard to find via google, so hopefully referencing these similar closed issues will get more people here who are looking for it:
- https://github.com/atom/autocomplete-plus/issues/471
- https://github.com/atom/autocomplete-plus/issues/277
- https://github.com/atom/autocomplete-plus/issues/86
Getting this issue myself, tried in safemode also and still happens. Found and fixed. see below
Did anyone find a solution for this?