From e9a71d22f3d1de4728707651a9079890c00f3e6b Mon Sep 17 00:00:00 2001 From: razetime Date: Thu, 11 Jan 2024 10:47:41 +0800 Subject: [PATCH] add prolog highlighter --- rc/filetype/prolog.kak | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 rc/filetype/prolog.kak diff --git a/rc/filetype/prolog.kak b/rc/filetype/prolog.kak new file mode 100644 index 00000000..fa183c15 --- /dev/null +++ b/rc/filetype/prolog.kak @@ -0,0 +1,49 @@ +# Prolog +# ---------------------- + +# Adapted from rc/filetype/erlang.kak + +# Detection +# ‾‾‾‾‾‾‾‾‾ +hook global BufCreate .*[.](pl|P) %{ + set-option buffer filetype prolog +} + +# Initialization +# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +hook global WinSetOption filetype=prolog %{ + require-module prolog + + hook -once -always window WinSetOption filetype=.* %{ remove-hooks window prolog-.+ } +} + +hook -group prolog-highlight global WinSetOption filetype=prolog %{ + add-highlighter window/prolog ref prolog + hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/prolog } +} + +provide-module prolog %[ + +# Highlighters +# ‾‾‾‾‾‾‾‾‾‾‾‾ + +add-highlighter shared/prolog regions +add-highlighter shared/prolog/default default-region group + +add-highlighter shared/prolog/comment region '(?