debug completion
This commit is contained in:
parent
bd75f7dd32
commit
9a58c366c6
@ -225,9 +225,8 @@ function M.trigger_completion()
|
|||||||
local context = {}
|
local context = {}
|
||||||
local cursor_line = line
|
local cursor_line = line
|
||||||
|
|
||||||
-- Add up to 10 previous lines for context
|
-- Add all previous lines for context
|
||||||
local start_line = math.max(1, line - 10)
|
for i = 1, line - 1 do
|
||||||
for i = start_line, line - 1 do
|
|
||||||
if lines[i] and #lines[i] > 0 then
|
if lines[i] and #lines[i] > 0 then
|
||||||
table.insert(context, string.format("L%d: %s", i, lines[i]))
|
table.insert(context, string.format("L%d: %s", i, lines[i]))
|
||||||
end
|
end
|
||||||
@ -240,9 +239,8 @@ function M.trigger_completion()
|
|||||||
table.insert(context, cursor_marker)
|
table.insert(context, cursor_marker)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Add up to 10 lines after current line
|
-- Add all remaining lines
|
||||||
local end_line = math.min(#lines, line + 10)
|
for i = line + 1, #lines do
|
||||||
for i = line + 1, end_line do
|
|
||||||
if lines[i] and #lines[i] > 0 then
|
if lines[i] and #lines[i] > 0 then
|
||||||
table.insert(context, string.format("L%d: %s", i, lines[i]))
|
table.insert(context, string.format("L%d: %s", i, lines[i]))
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user