summaryrefslogtreecommitdiff
path: root/rc/filetype/sql.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/sql.kak
parent887a5223ac8e71ca6d7f0cd9c764d68ce3d90dbe (diff)
Fixed many of the filetype support modules to not use `BufSetOption` to load
Diffstat (limited to 'rc/filetype/sql.kak')
-rw-r--r--rc/filetype/sql.kak24
1 files changed, 12 insertions, 12 deletions
diff --git a/rc/filetype/sql.kak b/rc/filetype/sql.kak
index 44ea7729..9ce82e67 100644
--- a/rc/filetype/sql.kak
+++ b/rc/filetype/sql.kak
@@ -8,10 +8,20 @@ hook global BufCreate .*/?(?i)sql %{
set-option buffer filetype sql
}
-hook -once global BufSetOption filetype=sql %{
+# Initialization
+# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+
+hook global WinSetOption filetype=sql %{
require-module sql
+ set-option window static_words %opt{sql_static_words}
}
+hook -group sql-highlight global WinSetOption filetype=sql %{
+ add-highlighter window/sql ref sql
+ hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/sql }
+}
+
+
provide-module sql %{
# Highlighters
@@ -86,9 +96,7 @@ evaluate-commands %sh{
data_types="${data_types}|Time|Ole Object|Hyperlink|Lookup Wizard"
# Add the language's grammar to the static completion list
- printf %s\\n "hook global WinSetOption filetype=sql %{
- set-option window static_words ${keywords} ${operators} ${functions} ${data_types} ${data_types_fn} NULL
- }" | tr '|' ' '
+ printf %s\\n "declare-option str-list sql_static_words ${keywords} ${operators} ${functions} ${data_types} ${data_types_fn} NULL" | tr '|' ' '
# Highlight keywords
printf %s "
@@ -104,12 +112,4 @@ add-highlighter shared/sql/code/ regex '\+|-|\*|/|%|&|\||^|=|>|<|>=|<=|<>|\+=|-=
add-highlighter shared/sql/code/ regex \bNULL\b 0:value
add-highlighter shared/sql/code/ regex \b\d+(?:\.\d+)?\b 0:value
-# Initialization
-# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-
-hook -group sql-highlight global WinSetOption filetype=sql %{
- add-highlighter window/sql ref sql
- hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/sql }
-}
-
}