Open velrest opened 4 years ago
The file needs a require-module html
, after line 12. Want to test that and create a PR? :)
Sure :+1:
@lenormf The error is now gone but now recursive call of hook WinSetOption/filetype=hbs, not executing
occurs and still no syntax highlighting. Sorry im new to kakoune and do not yet understand the hooks completely.
The following fixes it for me:
diff --git a/rc/filetype/hbs.kak b/rc/filetype/hbs.kak
index df854076..eb788b8b 100644
--- a/rc/filetype/hbs.kak
+++ b/rc/filetype/hbs.kak
@@ -10,6 +10,7 @@ hook global BufCreate .*[.](hbs) %{
hook global WinSetOption filetype=hbs %{
require-module hbs
+ require-module html
hook window ModeChange pop:insert:.* -group hbs-trim-indent hbs-trim-indent
hook window InsertChar \n -group hbs-indent hbs-indent-on-new-line
I'm just concerned now about maybe-add-hbs-to-html
, hbs_highlighters_enabled
and the reason for their existence.
The default regions should probably be HTML, and sub-regions highlight handlebars code - as opposed to having the module inject its highlighters into html
.
Ah true for me too, sorry not sure what i did wrong earlier. Thanks! Should i close this or leave it open for this issue?
I'm just concerned now about
maybe-add-hbs-to-html
,hbs_highlighters_enabled
and the reason for their existence.The default regions should probably be HTML, and sub-regions highlight handlebars code - as opposed to having the module inject its highlighters into
html
.
You can still create a PR if you're up for it (ideally fixing the script to highlight everything in HTML by default, to remove maybe-add-hbs-to-html
and hbs_highlighters_enabled
).
The commit message should end with "Fixes #3230", and this issue will be closed automatically upon merging.
@lenormf Sure, i would be glad to! It might take some time though since i really just started with kakoune and need some time to figure out how kakoune actually works :sweat_smile:.
You've got one commit figured out already (requiring html
). For the second commit, you need to make it so .hbs
buffers are highlighted as HTML by default, with handlebars highlighters on top.
The following file does exactly that, for another language: https://github.com/kakoune-editor/kakoune-extra-filetypes/blob/master/rc/clearsilver.kak#L32
@lenormf Hey, sorry for the long wait but i haven't had the time to work myself into the kakoune highlighters (sorry) so i opened a PR for the missing module part only (at least for now).
No problem, thanks.
On opening a
*.hbs
file i see following error message in*debug*
:This is probably caused by this line.
Steps
*.hbs
fileOutcome
Expected