Skip to content

Commit 1c75a79

Browse files
committed
Replace buf_line_count in ui tree expansion with -1
1 parent 3e7d794 commit 1c75a79

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

lua/dap/ui.lua

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,7 @@ function M.new_tree(opts)
216216
}
217217
context = vim.tbl_deep_extend('keep', context, extra_context)
218218
for _, child in pairs(opts.get_children(value)) do
219-
local ok, line_count = pcall(api.nvim_buf_line_count, layer.buf)
220-
if not ok then
221-
-- User might have closed the buffer
222-
return
223-
end
224-
layer.render({child}, with_indent(indent, opts.render_child), context, line_count)
219+
layer.render({child}, with_indent(indent, opts.render_child), context, -1)
225220
if is_expanded(child) then
226221
render_all_expanded(layer, child, indent + 2)
227222
end

spec/repl_spec.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,15 @@ describe('dap.repl', function()
135135
repl.execute("tbl")
136136
local commands = helpers.wait_for_response(server, "evaluate")
137137
assert.are.same({"initialize", "launch", "evaluate"}, commands)
138-
helpers.wait(function()
139-
local lines = api.nvim_buf_get_lines(buf, 0, -1, true)
140-
return lines[3] == "table xy"
141-
end)
138+
helpers.wait(
139+
function()
140+
local lines = api.nvim_buf_get_lines(buf, 0, -1, true)
141+
return lines[3] == "table xy"
142+
end,
143+
function()
144+
return api.nvim_buf_get_lines(buf, 0, -1, true)
145+
end
146+
)
142147
local lines = api.nvim_buf_get_lines(buf, 0, -1, true)
143148
local expected = {
144149
"",

0 commit comments

Comments
 (0)