Closed iambumblehead closed 2 years ago
from the buffer rendering this file, if I call M-x web-mode-set-content-type
to "css" this specific area gets nice syntax highlighting, so I believe web-mode is not detecting this expression correctly.
It would be very nice if web-mode included something could be engaged as web-mode-css
or web-mode-js
in order enable web-mode and specify the engine at the same time
this mmm-mode configuration captures and sends the open and close areas into web-mode [ ` ` ]
(mmm-add-classes
'((js-vue-css
:submode web-mode
:face mmm-declaration-submode-face
:front "styles: \\[ `"
:front-offset (end-of-line -3)
:back "` \\]"
:back-offset (end-of-line)
)))
(mmm-add-mode-ext-class 'js2-mode nil 'js-vue-css)
I want to say that web-mode is an amazing elisp file and thank you for creating and sharing it.
Searching for a way to unit-test the solution above surfaced this link https://zck.org/testing-buffer-modifying-emacs-code-again. It would be awesome if web-mode had a CI pipeline and a few unit-tests that honed in on areas like the one added to the diff further up.
Also, it would be awesome if web-mode exposed an interface to engage specific modes in specific areas from mmm-mode. The area in the diff is observably faster than the regexp-match loop following it and so areas defining their own syntax for web-mode could be handled in a faster way. Areas that processed in the slower loop are sometimes not syntax-highlighted when initially opening a file in emacs and updating this area might fix a few small issues.
Also, it would be awesome if web-mode could be configured like mmm-mode, so that the "front" and "back" regular expressions could be defined by the user for certain content-types. If this feature were supported web-mode content-types could be applied to any region defined by the user-configured front and back values
Hello, web-mode is not ment to work with mmm-mode. It is an autonomous mode.
i want to use web-mode to get css behaviour but all of the elements are aligned to left and there's no indentation or color. How are these enabled?
result