From 0c591baae3476ae0e60394c12f478f6c65f6fdc9 Mon Sep 17 00:00:00 2001 From: John Isom Date: Sat, 1 Aug 2020 09:49:53 -0600 Subject: [PATCH] Add 'crystal-indent-on-char' and 'crystal-insert-on-new-line' hooks and functions --- rc/filetype/crystal.kak | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rc/filetype/crystal.kak b/rc/filetype/crystal.kak index 0d5d1ca1..922321f1 100644 --- a/rc/filetype/crystal.kak +++ b/rc/filetype/crystal.kak @@ -17,7 +17,9 @@ hook global WinSetOption filetype=crystal %{ add-highlighter window/crystal ref crystal evaluate-commands set-option window static_words %opt{crystal_keywords} %opt{crystal_attributes} %opt{crystal_objects} + hook window InsertChar .* -group crystal-indent crystal-indent-on-char hook window InsertChar '\n' -group crystal-indent crystal-indent-on-new-line + hook window InsertChar '\n' -group crystal-insert crystal-insert-on-new-line hook -always -once window WinSetOption filetype=.* %{ remove-highlighter window/crystal @@ -186,6 +188,12 @@ define-command -hidden crystal-indent-on-new-line %{ } } +define-command -hidden crystal-insert-on-new-line %{ +} + +define-command -hidden crystal-indent-on-char %{ +} + define-command -hidden crystal-fetch-keywords %{ set-register dquote %sh{ curl --location https://github.com/crystal-lang/crystal/raw/master/src/compiler/crystal/syntax/lexer.cr |