Commit Graph

19 Commits

Author SHA1 Message Date
Olivier Perret
27f951638c Execute cleanup hooks on any filetype change 2018-12-11 00:35:57 +01:00
Olivier Perret
f5a2ded44b Change cleanup of extra/ languages to use a simpler hook -once 2018-12-11 00:13:30 +01:00
Matt Schick
8e698e0054 Simplify handlebars adding/removal hooks
Removing the handlebars highlighters when a client toggles away from hbs window unintentionally causes
other clients attached to hbs windows to no longer highlight correctly.  The only other option is to
copy the entire html highlighter and all of it's rules, but that seems like a maitenance headache.
So instead, just leave the hbs rules injected into the html rules once the user opens any handlebars file.
It's not ideal, but I'd say it's the least bad option.
2018-10-06 08:39:01 -05:00
Matt Schick
e7e87db94e Rework the handlebars highlighter
- Removes -recurse from handlebars comments. Handlebars parsers (janl/mustache.js, ember-cli/ember-cli-htmlbars), do not treat comments as recursive, so don't highlight them as so.
- Creates shared/hbs-file highligher group. This represents a handlebars file, which is html that happens to contain some handlebars tags.
- Augments the shared/html highlighter when needed. Because handlebars lives inside of html, we need to add the highlighter inside of it. Since there's no way to scope modifications of a shared highlighter to a window, here I'm modifying/unmodifying the shared/html highlighter whenever the user attaches/detaches a filetype of "hbs" to/from the window.
- Matches namespaced helpers as well. In htmlbars, helpers (components) can have '/'s in them, so make sure to continue highlighting through those. Also removes unused capturing groups.
- Allows for de-indenting when closing a block expression
- Brings in html highlighter hooks
- Improves indent matching on close of yielded blocks. Previous version just flat out didn't work.
2018-09-26 06:12:24 -05:00
Delapouite
425aa56eaf Use remove-hooks regex in rc 2018-09-19 19:59:57 +02:00
Maxime Coste
2e0e206951 Make recurse regex opt-in with a -recurse switch instead of opt-out 2018-07-05 07:54:28 +10:00
Maxime Coste
9ea6b88c1f Fix remaining kak scripts to use the new highlighter syntax 2018-07-05 07:54:28 +10:00
Maxime Coste
43f50c0852 Convert bundled scripts to ModeChange hook 2018-01-21 10:35:05 +11:00
Frank LENORMAND
9127ed0d55 src rc: Rename exec/eval into execute-keys/evaluate-commands 2017-11-03 11:09:45 +03:00
Frank LENORMAND
c9b280b712 rc: Don't use command aliases to highlight keywords properly 2017-11-03 10:34:41 +03:00
Maxime Coste
d49555fc75 Move highlighters into Scopes
That means we can now have highlighters active at global, buffer, and
window scope. The add-highlighter and remove-highlighter syntax changed
to take the parent path (scope/group/...) as a mandatory argument,
superseeding the previous -group switch.
2017-10-28 13:43:04 +08:00
Maxime Coste
80d661e6a7 rc/: More consistent uses of regex syntax
Always use \A \z for subject start/end, always \b for word boundaries
2017-10-25 10:27:25 +08:00
Maxime Coste
5ad4499503 Fix naming conventions in bundled scripts
Do not use _ prefix for hidden commands, use - as a word separator
in command names.
2017-01-13 01:00:43 +00:00
Maxime Coste
91a56c11fe Various auto indent fixes regarding wrong use of x instead of <a-x> 2017-01-13 00:50:03 +00:00
Maxime Coste
5989903e7c Copy comments *before* copying indentation
Fixes #1118
2017-01-11 13:56:48 +00:00
Maxime Coste
343df600cb Merge remote-tracking branch 'alexherbo2/command-names' 2017-01-10 13:44:11 +00:00
Matt Schick
e1833801f8 Change html highlighting to be ref inside of hbs highlighting 2017-01-08 17:29:36 -08:00
Alex Leferry 2
671b50bb52 update command names 2017-01-04 13:04:27 +01:00
Harm Aarts
f9c860d235 Add Handlebars syntax highlighting.
This is based on the HAML syntax highlighting. Of note is the loading of
the html highlighter since Handlebars is embedded in html.
2016-12-21 21:31:05 +01:00