diff options
| author | Lewis Russell <lewis6991@gmail.com> | 2021-11-18 09:51:03 +0000 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2021-11-23 10:02:06 +0100 |
| commit | 011ac894ec5b9e36563d8629fb7734f43ddb27a8 (patch) | |
| tree | de0b252b7705bfa4304c08cd389fed0814ae6f1c /queries/lua | |
| parent | Update lockfile.json (diff) | |
| download | nvim-treesitter-011ac894ec5b9e36563d8629fb7734f43ddb27a8.tar nvim-treesitter-011ac894ec5b9e36563d8629fb7734f43ddb27a8.tar.gz nvim-treesitter-011ac894ec5b9e36563d8629fb7734f43ddb27a8.tar.bz2 nvim-treesitter-011ac894ec5b9e36563d8629fb7734f43ddb27a8.tar.lz nvim-treesitter-011ac894ec5b9e36563d8629fb7734f43ddb27a8.tar.xz nvim-treesitter-011ac894ec5b9e36563d8629fb7734f43ddb27a8.tar.zst nvim-treesitter-011ac894ec5b9e36563d8629fb7734f43ddb27a8.zip | |
Prefer lua-match over match
as string.find is much quicker than vim.regex:match*
Diffstat (limited to 'queries/lua')
| -rw-r--r-- | queries/lua/highlights.scm | 2 | ||||
| -rw-r--r-- | queries/lua/injections.scm | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/queries/lua/highlights.scm b/queries/lua/highlights.scm index 842ed64da..2c7291b9f 100644 --- a/queries/lua/highlights.scm +++ b/queries/lua/highlights.scm @@ -116,7 +116,7 @@ (nil) @constant.builtin (spread) @constant ;; "..." ((identifier) @constant - (#match? @constant "^[A-Z][A-Z_0-9]*$")) + (#lua-match? @constant "^[A-Z][A-Z_0-9]*$")) ;; Functions (function [(function_name) (identifier)] @function) diff --git a/queries/lua/injections.scm b/queries/lua/injections.scm index 65b8b304b..fa05c40a7 100644 --- a/queries/lua/injections.scm +++ b/queries/lua/injections.scm @@ -8,7 +8,7 @@ ) (#eq? @_cdef_identifier "cdef") - (#match? @c "^[\"']") + (#lua-match? @c "^[\"']") (#offset! @c 0 1 0 -1) ) @@ -21,7 +21,7 @@ ) (#eq? @_cdef_identifier "cdef") - (#match? @c "^\\[\\[") + (#lua-match? @c "^%[%[") (#offset! @c 0 2 0 -2) ) @@ -34,7 +34,7 @@ ) (#any-of? @_vimcmd_identifier "vim.cmd" "vim.api.nvim_command" "vim.api.nvim_exec") - (#match? @vim "^[\"']") + (#lua-match? @vim "^[\"']") (#offset! @vim 0 1 0 -1) ) @@ -46,7 +46,7 @@ ) (#any-of? @_vimcmd_identifier "vim.cmd" "vim.api.nvim_command" "vim.api.nvim_exec") - (#match? @vim "^\\[\\[") + (#lua-match? @vim "^%[%[") (#offset! @vim 0 2 0 -2) ) |
