diff --git a/NEWS.md b/NEWS.md index c1879228..1e8ce5f9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ Red Panda C++ Version 2.8 - fix: Crash when editing makefile - enhancement: Add "Resources" in project option's dialog's custom compiler parameter page + - fix: Crash while input using input method in makefile Red Panda C++ Version 2.7 diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index a3f76ca8..73c2a453 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -1319,7 +1319,7 @@ void Editor::inputMethodEvent(QInputMethodEvent *event) && pSettings->codeCompletion().showCompletionWhileInput() ) { if (mLastIdCharPressed>=pSettings->codeCompletion().minCharRequired()) { QString lastWord = getPreviousWordAtPositionForSuggestion(caretXY()); - if (!lastWord.isEmpty()) { + if (mParser && !lastWord.isEmpty()) { if (CppTypeKeywords.contains(lastWord)) { return; } @@ -3515,7 +3515,7 @@ bool Editor::onCompletionInputMethod(QInputMethodEvent *event) if (!mCompletionPopup->isVisible()) return processed; QString s=event->commitString(); - if (!s.isEmpty()) { + if (mParser && !s.isEmpty()) { QString phrase = getWordForCompletionSearch(caretXY(),mCompletionPopup->memberOperator()=="::"); mLastIdCharPressed = phrase.length(); mCompletionPopup->search(phrase, false);