fix(lsp): ignore invalid fold ranges (#36708)

This commit is contained in:
Miika Tuominen
2025-11-27 01:47:07 +02:00
committed by GitHub
parent 8a626e5c4a
commit 7ebfc50775

View File

@@ -56,8 +56,8 @@ function State:evaluate()
for _, range in ipairs(ranges) do
local start_row = range.startLine
local end_row = range.endLine
-- Adding folds within a single line is not supported by Nvim.
if start_row ~= end_row then
-- Ignore zero-length or invalid folds
if start_row < end_row then
row_text[start_row] = range.collapsedText
local kind = range.kind