mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -04:00
also pass the node to the statusline transform fn
This commit is contained in:
parent
a744ed1b27
commit
22de3532cc
1 changed files with 1 additions and 1 deletions
|
|
@ -51,7 +51,7 @@ function M._get_line_for_node(node, type_patterns, transform_fn, bufnr)
|
||||||
if not is_valid then
|
if not is_valid then
|
||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
local line = transform_fn(vim.trim(get_node_text(node, bufnr)[1] or ""))
|
local line = transform_fn(vim.trim(get_node_text(node, bufnr)[1] or ""), node)
|
||||||
-- Escape % to avoid statusline to evaluate content as expression
|
-- Escape % to avoid statusline to evaluate content as expression
|
||||||
return line:gsub("%%", "%%%%")
|
return line:gsub("%%", "%%%%")
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue