Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: use parser:lang() instead of vim.bo.filetype
  • Loading branch information
Kaiser-Yang committed May 9, 2025
commit 0e9c94f654b130b112ee39f5b0623d054d39c12b
2 changes: 1 addition & 1 deletion doc/recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ local function inside_comment_block()
end
local node_under_cursor = vim.treesitter.get_node()
local parser = vim.treesitter.get_parser(nil, nil, { error = false })
local query = vim.treesitter.query.get(vim.bo.filetype, 'highlights')
local query = vim.treesitter.query.get(parser:lang(), 'highlights')
if not parser or not node_under_cursor or not query then
return false
end
Expand Down