summaryrefslogtreecommitdiff
path: root/rc/filetype/php.kak
diff options
context:
space:
mode:
authorJustin Frank <justinpfrank@protonmail.com>2019-04-09 20:54:19 -0700
committerJustin Frank <justinpfrank@protonmail.com>2019-04-09 20:54:19 -0700
commit80ac46e09de0a30c0bf590fd50b6cbf9bfd1c41b (patch)
treed4abde4c341a026d56512d74f79608d6a45ec85a /rc/filetype/php.kak
parent887a5223ac8e71ca6d7f0cd9c764d68ce3d90dbe (diff)
Fixed many of the filetype support modules to not use `BufSetOption` to load
Diffstat (limited to 'rc/filetype/php.kak')
-rw-r--r--rc/filetype/php.kak32
1 files changed, 15 insertions, 17 deletions
diff --git a/rc/filetype/php.kak b/rc/filetype/php.kak
index e2759129..8ee1d8ce 100644
--- a/rc/filetype/php.kak
+++ b/rc/filetype/php.kak
@@ -5,8 +5,22 @@ hook global BufCreate .*[.](php) %{
set-option buffer filetype php
}
-hook -once global BufSetOption filetype=php %{
+# Initialization
+# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+
+hook global WinSetOption filetype=php %{
require-module php
+
+ hook window ModeChange insert:.* -group php-trim-indent php-trim-indent
+ hook window InsertChar .* -group php-indent php-indent-on-char
+ hook window InsertChar \n -group php-indent php-indent-on-new-line
+
+ hook -once -always window WinSetOption filetype=.* %{ remove-hooks window php-.+ }
+}
+
+hook -group php-highlight global WinSetOption filetype=php %{
+ add-highlighter window/php-file ref php-file
+ hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/php-file }
}
provide-module php %(
@@ -80,20 +94,4 @@ define-command -hidden php-indent-on-new-line %<
>
>
-# Initialization
-# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-
-hook -group php-highlight global WinSetOption filetype=php %{
- add-highlighter window/php-file ref php-file
- hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/php-file }
-}
-
-hook global WinSetOption filetype=php %{
- hook window ModeChange insert:.* -group php-trim-indent php-trim-indent
- hook window InsertChar .* -group php-indent php-indent-on-char
- hook window InsertChar \n -group php-indent php-indent-on-new-line
-
- hook -once -always window WinSetOption filetype=.* %{ remove-hooks window php-.+ }
-}
-
)