Add basic vimscript injection in vim.cmd/nvim_command/nvim_exec (#1922)

This commit is contained in:
vhyrro 2021-11-17 03:14:22 +01:00 committed by GitHub
parent bc7fb7fe7f
commit d78fb79ed6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,3 +1,4 @@
; C Injections
(
(function_call
(field_expression
@ -24,4 +25,29 @@
(#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