We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2e4f0f9 + 3ed4bba commit 1fef581Copy full SHA for 1fef581
1 file changed
lua/dim.lua
@@ -77,6 +77,14 @@ end
77
function util.get_treesitter_hl(row, col)
78
local buf = vim.api.nvim_get_current_buf()
79
80
+ -- NOTE: use new functionality from https://github.com/neovim/neovim/issues/14090#issuecomment-1228444035
81
+ if vim.treesitter.get_captures_at_position ~= nil then
82
+ local matches = vim.treesitter.get_captures_at_position(buf, row, col)
83
+ return vim.tbl_map(function(match)
84
+ return "@" .. match.capture
85
+ end, matches)
86
+ end
87
+
88
local self = highlighter.active[buf]
89
if not self then
90
return {}
0 commit comments