Skip to content

Commit 3afb083

Browse files
committed
add bufnr to ts_query.get_node_text
1 parent ecc76eb commit 3afb083

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: lua/nvim-treesitter-refactor/navigation.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function M.list_definitions(bufnr)
7171
for _, node in ipairs(definitions) do
7272
local lnum, col, _ = node.node:start()
7373
local type = string.upper(node.type:sub(1, 1))
74-
local text = ts_query.get_node_text(node.node) or ""
74+
local text = ts_query.get_node_text(node.node, bufnr) or ""
7575
table.insert(qf_list, {
7676
bufnr = bufnr,
7777
lnum = lnum + 1,
@@ -126,7 +126,7 @@ function M.list_definitions_toc()
126126

127127
local lnum, col, _ = def.node:start()
128128
local type = string.upper(def.type:sub(1, 1))
129-
local text = ts_query.get_node_text(def.node) or ""
129+
local text = ts_query.get_node_text(def.node, bufnr) or ""
130130
table.insert(loc_list, {
131131
bufnr = bufnr,
132132
lnum = lnum + 1,

Diff for: lua/nvim-treesitter-refactor/smart_rename.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function M.smart_rename(bufnr)
4343
return
4444
end
4545

46-
local node_text = ts_query.get_node_text(node_at_point)
46+
local node_text = ts_query.get_node_text(node_at_point, bufnr)
4747
local input = { prompt = "New name: ", default = node_text or "" }
4848
if not vim.ui.input then
4949
local new_name = vim.fn.input(input.prompt, input.default)

0 commit comments

Comments
 (0)