From 1b5763ce26b7112972e83f84ec140941497575f8 Mon Sep 17 00:00:00 2001 From: CppCXY <812125110@qq.com> Date: Thu, 30 Nov 2023 14:07:27 +0800 Subject: [PATCH] fix range format bug --- CodeFormatCore/src/RangeFormat/RangeFormatBuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeFormatCore/src/RangeFormat/RangeFormatBuilder.cpp b/CodeFormatCore/src/RangeFormat/RangeFormatBuilder.cpp index 65b4dc92..5415532c 100644 --- a/CodeFormatCore/src/RangeFormat/RangeFormatBuilder.cpp +++ b/CodeFormatCore/src/RangeFormat/RangeFormatBuilder.cpp @@ -126,7 +126,7 @@ void RangeFormatBuilder::CheckRange(LuaSyntaxNode &syntaxNode, const LuaSyntaxTr switch (_validRange) { case Valid::Init: { auto tokenEndLine = endNode.GetEndLine(t); - if (tokenEndLine >= _range.StartLine) { + if (tokenEndLine >= _range.StartLine && tokenEndLine <= _range.EndLine) { _validRange = Valid::Process; auto tokenStartLine = startNode.GetStartLine(t); if (tokenStartLine < _range.StartLine) {