From 79fa50dc3e47c1be95ecde34e70a3bc0c73f4c26 Mon Sep 17 00:00:00 2001 From: John Isom Date: Sat, 1 Aug 2020 09:24:06 -0600 Subject: [PATCH] Add namespacing to crystal hooks --- rc/filetype/crystal.kak | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rc/filetype/crystal.kak b/rc/filetype/crystal.kak index ae1ce819..b57f1518 100644 --- a/rc/filetype/crystal.kak +++ b/rc/filetype/crystal.kak @@ -7,12 +7,15 @@ hook global BufCreate '.*\.cr' %{ hook global WinSetOption filetype=crystal %{ require-module crystal - evaluate-commands set-option window static_words %opt{crystal_keywords} %opt{crystal_attributes} %opt{crystal_objects} + add-highlighter window/crystal ref crystal - hook -group crystal window InsertChar '\n' crystal-new-line-inserted + evaluate-commands set-option window static_words %opt{crystal_keywords} %opt{crystal_attributes} %opt{crystal_objects} + + hook window InsertChar '\n' -group crystal-indent crystal-new-line-inserted + hook -always -once window WinSetOption filetype=.* %{ remove-highlighter window/crystal - remove-hooks window crystal + remove-hooks window crystal-.+ } }