CSS Auto Indentation not working
Closed this issue · 15 comments
Prerequisites
- 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
Indentation with: {}, [], () do not work using the CSS syntax.
Steps to Reproduce
- Create a new blank file
- Change the langauge to Atom's default 'CSS' syntax.
- Create a simple CSS rule
Where '|' is the I-cursor in Atom, and the indentation setting is set to 'Tabs (4 wide)'...
Expected behavior:
.cssrule'{
'''|
}
Actual behavior:
.cssrule'{
|
}
Reproduces how often:
This happens for me 100% of the time, in my normal work environment and in safe mode.
Versions
Atom : 1.15.0
Electron: 1.3.13
Chrome : 52.0.2743.82
Node : 6.5.0
Additional Information
Auto indentation is enabled in the settings, and works for all other langauges I use.
I for some reason, have two 'CSS' languages when changing, although neither work.
Thank you for your issue!
I noticed that your image does not seem to be taken in safe mode. Do the duplicate CSS languages still appear even in safe mode?
@DijitulLiam Could you also include a list of which packages you have installed? Just run this in Terminal, and copy+paste the output:
apm ls --installed
It sounds like you may have another CSS package installed which is shadowing the "real" CSS grammar in the selection list (e.g., selecting the second css
entry will select the first entry that's named css
).
Hi guys,
Thanks for getting back, and apologies for the late reply.
The duplicate CSS languages isn't an issue in safe mode, but the issue still persists.
@Alhadis
├── atom-alignment@0.12.1
├── atom-beautify@0.29.17
├── atom-material-syntax@1.0.2
├── atom-material-syntax-dark@0.2.7
├── atom-material-syntax-light@0.4.6
├── atom-material-ui@1.3.9
├── atom-ternjs@0.18.2
├── atom-wrap-in-tag@0.6.0
├── auto-detect-indentation@1.3.0
├── autocomplete-xml@0.9.4
├── busy-signal@1.3.0
├── emmet@2.4.3
├── file-icons@2.0.17
├── file-types@0.5.5
├── fonts@2.0.0
├── intentions@1.1.2
├── language-babel@2.56.2
├── linter@2.1.0
├── linter-htmlhint@1.3.2
├── linter-php@1.3.1
├── linter-ruby@1.2.5
├── linter-ui-default@1.2.1
├── linter-xo
├── markdown-preview-plus@2.4.9
├── minimap@4.26.8
├── minimap-highlight-selected@4.5.0
├── pigments@0.39.0
├── project-manager@3.3.3
├── sort-lines@0.14.0
├── white-cursor@0.7.0
└── xml-formatter@0.10.0
Can you confirm that the bracket-matcher package is enabled?
bracket-matcher is installed, disabling it, however, doesn't fix the issue.
This is also true for Safe Mode.
Do you have any strange keybindings attached to the Enter (or Return) key, perchance? Anything that might be overriding the default editor:newline
command?
Unless one of the packages installed has this effect, no. I haven't personally changed anything like that.
Hmm. This is really weird. Not sure what else to try.
It's only CSS that's the issue which is the reason it's throwing me off, as all other languages are fine.
EDIT: Not sure if I can close this at my end so I'll leave this open for now. Thanks guys!
Hey again, done a full reinstall, removing all packages from Atom itself, then going ahead and removing the .atom folder completely just to make sure.
The issue has gone, so I can only assume this was a package specific problem, this is my new package list. (Ended up dropping a few due to house cleaning, not needing).
├── atom-material-ui@1.3.9
├── auto-detect-indentation@1.3.0
├── busy-signal@1.3.0
├── emmet@2.4.3
├── file-icons@2.0.17
├── intentions@1.1.2
├── language-babel@2.57.0
├── linter@2.1.0
├── linter-php@1.3.2
├── linter-ui-default@1.2.1
├── markdown-preview-plus@2.4.9
├── minimap-pigments@0.2.2
├── pigments@0.39.1
└── project-manager@3.3.3
Ok, glad that it's working now. If it happens again, please comment here and we'll keep investigating.
I've started experiencing this too. The same as what @DijitulLiam described: CSS files don't indent automatically, though all other file types do.
I mainly use .scss
files, so I haven't noticed this issue before now. But I've been working directly with .css
files recently and this is getting annoying. Please let me know what information you need from me to debug/reproduce.