From 804ff6085e41a4e19f6298a5e5cd1d26868f1d1c Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sun, 3 Mar 2024 12:31:24 +0800 Subject: [PATCH] - fix: Issue #230 Crash when input " in the txt files. --- NEWS.md | 1 + RedPandaIDE/editor.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 672b16b7..a827adff 100644 --- a/NEWS.md +++ b/NEWS.md @@ -25,6 +25,7 @@ Red Panda C++ Version 2.27 - fix: issue #215 (Caret may be drawn in the gutter.) - change: Force use utf8 as the exec encoding for fmtlib in the auto link options page. - fix: After spaces in comments and strings, symbol completion for '{' and '(' are wrong. + - fix: Issue #230 Crash when input " in the txt files. Red Panda C++ Version 2.26 - enhancement: Code suggestion for embedded std::vectors. diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index 4b53f09d..6a621146 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -2957,7 +2957,10 @@ bool Editor::handleDoubleQuoteCompletion() endEditing(); return true; } - if ((ch == 0) || syntaxer()->isWordBreakChar(ch) || syntaxer()->isSpaceChar(ch)) { + if ((ch == 0) + || !syntaxer() + || ( syntaxer()->isWordBreakChar(ch) + || syntaxer()->isSpaceChar(ch))) { // insert "" beginEditing(); processCommand(QSynedit::EditCommand::Char,'"');