atom/language-css

CSS Auto Indentation not working

Closed this issue · 15 comments

Prerequisites

Description

Indentation with: {}, [], () do not work using the CSS syntax.

Steps to Reproduce

  1. Create a new blank file
  2. Change the langauge to Atom's default 'CSS' syntax.
  3. 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.

two 'CSS' languages

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.

image

The duplicate CSS languages isn't an issue in safe mode, but the issue still persists.

image

@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.

I've now also checked my language's again, and I now have a duplicate of all CSS related languages apart from "styled CSS"

image

image

I'm going to do a full uninstall, re-install (including packages) to see if this is the issue, and find out exactly where this CSS issue is coming from.

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.

Peek 2019-06-20 15-04

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.

@bwpanda can you please open a new issue?

@50Wliu I found the issue: I had disabled the core language-source package. Re-enabling it fixed the issue for me.

I see this as a bug though, so I've created a bug report here: #162