From 507d48c3ae2b1a255dc81c05f0ecf8b5b1766fbd Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Mon, 8 Dec 2025 13:49:38 -0600 Subject: [PATCH] plugins/treesitter: update injections to handle functions Handle highlighting strings that occur after a function condition. --- plugins/by-name/treesitter/injections.scm | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/plugins/by-name/treesitter/injections.scm b/plugins/by-name/treesitter/injections.scm index c4d3adfb..49320196 100644 --- a/plugins/by-name/treesitter/injections.scm +++ b/plugins/by-name/treesitter/injections.scm @@ -13,6 +13,20 @@ ] (#match? @_path "(^(extraConfigLua(Pre|Post)?|__raw))$")) +(binding + attrpath: (attrpath + (identifier) @_path) + expression: (apply_expression + argument: [ + (string_expression + ((string_fragment) @injection.content + (#set! injection.language "lua"))) + (indented_string_expression + ((string_fragment) @injection.content + (#set! injection.language "lua"))) + ]) + (#match? @_path "(^(extraConfigLua(Pre|Post)?|__raw))$")) + (apply_expression function: (_) @_func argument: [ @@ -38,6 +52,20 @@ ] (#match? @_path "(^extraConfigVim(Pre|Post)?)$")) +(binding + attrpath: (attrpath + (identifier) @_path) + expression: (apply_expression + argument: [ + (string_expression + ((string_fragment) @injection.content + (#set! injection.language "vim"))) + (indented_string_expression + ((string_fragment) @injection.content + (#set! injection.language "vim"))) + ]) + (#match? @_path "(^extraConfigVim(Pre|Post)?)$")) + (binding attrpath: (attrpath (identifier) @namespace