mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-15 09:50:04 -04:00
Add basic vimscript injection in vim.cmd/nvim_command/nvim_exec (#1922)
This commit is contained in:
parent
bc7fb7fe7f
commit
d78fb79ed6
1 changed files with 26 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
; C Injections
|
||||||
(
|
(
|
||||||
(function_call
|
(function_call
|
||||||
(field_expression
|
(field_expression
|
||||||
|
|
@ -24,4 +25,29 @@
|
||||||
(#offset! @c 0 2 0 -2)
|
(#offset! @c 0 2 0 -2)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
; Vimscript Injections
|
||||||
|
(
|
||||||
|
(function_call
|
||||||
|
(field_expression) @_vimcmd_identifier
|
||||||
|
(arguments
|
||||||
|
(string) @vim)
|
||||||
|
)
|
||||||
|
|
||||||
|
(#any-of? @_vimcmd_identifier "vim.cmd" "vim.api.nvim_command" "vim.api.nvim_exec")
|
||||||
|
(#match? @vim "^[\"']")
|
||||||
|
(#offset! @vim 0 1 0 -1)
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
(function_call
|
||||||
|
(field_expression) @_vimcmd_identifier
|
||||||
|
(arguments
|
||||||
|
(string) @vim)
|
||||||
|
)
|
||||||
|
|
||||||
|
(#any-of? @_vimcmd_identifier "vim.cmd" "vim.api.nvim_command" "vim.api.nvim_exec")
|
||||||
|
(#match? @vim "^\\[\\[")
|
||||||
|
(#offset! @vim 0 2 0 -2)
|
||||||
|
)
|
||||||
|
|
||||||
(comment) @comment
|
(comment) @comment
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue