From f7aa21579dc982299800cd578601bd4701512916 Mon Sep 17 00:00:00 2001 From: jdunlap Date: Sun, 3 Jan 2021 00:42:10 -0600 Subject: [PATCH] Update TextEditor.cpp Fixed an error where all text would be detected as a multi-line comment if no start and end strings were defined. Not all languages have multi-line comments, so this is a necessary fix. --- TextEditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TextEditor.cpp b/TextEditor.cpp index 02966f0b..37adc769 100644 --- a/TextEditor.cpp +++ b/TextEditor.cpp @@ -2335,7 +2335,7 @@ void TextEditor::ColorizeInternal() { withinSingleLineComment = true; } - else if (!withinSingleLineComment && currentIndex + startStr.size() <= line.size() && + else if (startStr.size() != 0 && !withinSingleLineComment && currentIndex + startStr.size() <= line.size() && equals(startStr.begin(), startStr.end(), from, from + startStr.size(), pred)) { commentStartLine = currentLine;