mutian / Sublime-CSS-Format

CSS Formatting for Sublime Text
http://mutian.github.io/Sublime-CSS-Format/
MIT License
98 stars 27 forks source link

selection is unindented #28

Closed hyperknot closed 9 years ago

hyperknot commented 9 years ago
  1. Enable format on save
  2. Select some text, for example one selector in LESS
  3. If you save with this selection, the selected text will be unindented.
  4. If you save with nothing selected, everything will be indented correctly.
mutian commented 9 years ago

@hyperknot

If you select some code, and run format command, only the selection will be formatted. The selection will be regarded as a new context, indentation is only in the new context.

Considering format_on_save usage scenario, I disabled selection detect, if you select some code, and save with the selection, the whole file will be formatted and indented.

hyperknot commented 9 years ago

Thanks, I agree it make sense on command, it just doesn't make sense on save.