Skip to content

Commit

Permalink
fix folding exception when adding tags before a Background #125
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrafung committed Jun 7, 2021
1 parent b6aaaad commit 5dcea4f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ private static void FoldNode(ITreeNode node, FoldingHighlightingConsumer consume

private static int CalculateLength(DocumentRange? textRange, DocumentRange keywordRange, DocumentRange range)
{
if (!keywordRange.IsValid() || !range.IsValid())
return 0;

if (textRange.HasValue && !textRange.Value.IsValid())
return 0;

if (keywordRange == range)
return 0;

Expand Down

0 comments on commit 5dcea4f

Please sign in to comment.