2018-06-19 12:40:33 +03:00
|
|
|
hook global BufCreate .+\.cmake|.*/CMakeLists.txt %{
|
|
|
|
set-option buffer filetype cmake
|
|
|
|
}
|
|
|
|
|
2018-07-19 11:40:07 +03:00
|
|
|
hook global BufCreate .*/CMakeCache.txt %{
|
|
|
|
set-option buffer filetype ini
|
|
|
|
}
|
|
|
|
|
2019-03-14 00:00:59 +03:00
|
|
|
hook -once global BufSetOption filetype=cmake %{
|
|
|
|
require-module cmake
|
|
|
|
}
|
|
|
|
|
|
|
|
provide-module cmake %{
|
|
|
|
|
2018-06-30 02:49:57 +03:00
|
|
|
add-highlighter shared/cmake regions
|
|
|
|
add-highlighter shared/cmake/code default-region group
|
2018-07-02 13:59:12 +03:00
|
|
|
add-highlighter shared/cmake/comment region '#' '$' fill comment
|
|
|
|
add-highlighter shared/cmake/argument region -recurse '\(' '\w+\h*\(\K' '(?=\))' regions
|
2018-06-19 12:40:33 +03:00
|
|
|
|
2018-06-30 02:49:57 +03:00
|
|
|
add-highlighter shared/cmake/code/ regex '\w+\h*(?=\()' 0:meta
|
2018-06-19 12:40:33 +03:00
|
|
|
|
2018-06-30 02:49:57 +03:00
|
|
|
add-highlighter shared/cmake/argument/args default-region regex '\$\{\w+\}' 0:variable
|
2018-07-02 13:59:12 +03:00
|
|
|
add-highlighter shared/cmake/argument/quoted region '"' '(?<!\\)(\\\\)*"' group
|
|
|
|
add-highlighter shared/cmake/argument/raw-quoted region -match-capture '\[(=*)\[' '\](=*)\]' ref cmake/argument/quoted
|
2018-06-19 12:40:33 +03:00
|
|
|
|
2018-06-30 02:49:57 +03:00
|
|
|
add-highlighter shared/cmake/argument/quoted/ fill string
|
|
|
|
add-highlighter shared/cmake/argument/quoted/ regex '\$\{\w+\}' 0:variable
|
|
|
|
add-highlighter shared/cmake/argument/quoted/ regex '\w+\h*(?=\()' 0:function
|
2018-06-19 12:40:33 +03:00
|
|
|
|
2018-11-28 12:39:18 +03:00
|
|
|
hook -group cmake-highlight global WinSetOption filetype=cmake %{
|
|
|
|
add-highlighter window/cmake ref cmake
|
2018-12-11 02:11:35 +03:00
|
|
|
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/cmake }
|
2018-11-28 12:39:18 +03:00
|
|
|
}
|
2019-03-14 00:00:59 +03:00
|
|
|
|
|
|
|
}
|