scss-mode
scss-mode copied to clipboard
Improve single- and multi-line comment support
Oftentimes when browsing SCSS files I stumble across a comment that flies off the screen. Habitually I place point inside the comment and do M-q with the expectation that Emacs will magically prevent any words from spanning across the sacred 80-column mark. But alas, when I do that, the following
// Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children.
becomes
// Blessed is he who, in the name of charity and good will, shepherds the weak
through the valley of darkness, for he is truly his brother's keeper and the
finder of lost children.
Another issue: I want my multi-line comments to have stars along the left side. But when I try to fill this:
/*
* Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children.
*/
I get this:
/* * Blessed is he who, in the name of charity and good will, shepherds the weak
through the valley of darkness, for he is truly his brother's keeper and the
finder of lost children. */
With this PR, indentation will instead behave as expected for the aforementioned cases, respectively:
// Blessed is he who, in the name of charity and good will, shepherds the weak
// through the valley of darkness, for he is truly his brother's keeper and the
// finder of lost children.
/*
* Blessed is he who, in the name of charity and good will, shepherds the weak
* through the valley of darkness, for he is truly his brother's keeper and the
* finder of lost children.
*/
Bump. Interested in these updates?
Yes, just tried it, I get an error fill-paragraph: Symbol's function definition is void: c-fill-paragraph
though...
Whoops. Try it now.
Added an additional fix for M-j
when within a multiline comment.
Hey there. Is this working for you now?
Bump.
Time for another bump.
I'm seconding @jacksonrayhamilton. Is this project dead? Else, I'll fork it since I've got several useful functions to be added to the mode.
FWIW, Emacs 25 is providing its own scss-mode
which is almost the same as this one. (It's embedded inside css-mode.el
on Emacs' master
branch.) Might be better to focus our energy there, instead.
@jacksonrayhamilton Thanks for the info! Native Emacs doesn't (and shouldn't?) implement something like rainbow-mode. It's sad that Emacs doesn't include things like that as Sublime does. The compilation process is also not present.
IMO, it's no big deal if the editor doesn't ship with some packages. That's the great thing about an extensible editor, and an extensible language like LISP: It's easy to add anything you want.
For compilation in particular, I don't think it's necessary for that to be built into SCSS mode. That belongs in a build file, which one can run via a keybinding. External build systems decouple your project from a particular editor, which avoids vendor lock-in and allows anyone on a team to use their favorite IDE.