- change: Symbol completion of '(' won't test current character at the cursor.

- change: Symbol completion of '{' won't insert extra new lines.
This commit is contained in:
Roy Qu 2023-08-23 17:24:07 +08:00
parent 23a1a80890
commit 10c134a5c7
4 changed files with 18 additions and 15 deletions

View File

@ -1,3 +1,8 @@
Red Panda C++ Version 2.25
- change: Symbol completion of '(' won't test current character at the cursor.
- change: Symbol completion of '{' won't insert extra new lines.
Red Panda C++ Version 2.24 Red Panda C++ Version 2.24
- fix: members of elements of stl maps are not correctly suggested. - fix: members of elements of stl maps are not correctly suggested.

View File

@ -14,7 +14,7 @@ isEmpty(APP_NAME) {
} }
isEmpty(APP_VERSION) { isEmpty(APP_VERSION) {
APP_VERSION = 2.24 APP_VERSION = 2.25
} }
contains(QMAKE_HOST.arch, x86_64):{ contains(QMAKE_HOST.arch, x86_64):{

View File

@ -1014,23 +1014,23 @@ void Editor::keyPressEvent(QKeyEvent *event)
case '}': case '}':
case '[': case '[':
case ']': case ']':
case '<':
case '*': case '*':
case ';': case ';':
case ',': case ',':
case '(':
handled = handleSymbolCompletion(ch); handled = handleSymbolCompletion(ch);
return; return;
case '(': { // QChar nextCh;
QChar nextCh = nextNonSpaceChar(caretY()-1,caretX()-1); // if (selAvail()) {
if (!isIdentChar(nextCh) && nextCh!='(' // nextCh = nextNonSpaceChar(caretY()-1,caretX()-1);
&& nextCh!='"' && nextCh!='\'' ){ // } else {
handled = handleSymbolCompletion(ch); // nextCh = nextNonSpaceChar(caretY()-1,caretX()-1);
} // }
return; // if (!isIdentChar(nextCh) && nextCh!='('
} // && nextCh!='"' && nextCh!='\'' ){
case '<':
case '>': case '>':
if ((caretX() <= 1) || lineText().isEmpty() if (mParser) {
|| lineText()[caretX() - 2] != '-') {
handled = handleSymbolCompletion(ch); handled = handleSymbolCompletion(ch);
return; return;
} }
@ -2740,9 +2740,7 @@ bool Editor::handleBraceCompletion()
if (text.isEmpty()) { if (text.isEmpty()) {
oldCaret = caretXY(); oldCaret = caretXY();
} else { } else {
processCommand(QSynedit::EditCommand::InsertLine);
setSelText(text); setSelText(text);
processCommand(QSynedit::EditCommand::InsertLine);
} }
processCommand(QSynedit::EditCommand::Char,'}'); processCommand(QSynedit::EditCommand::Char,'}');

View File

@ -14,7 +14,7 @@ qsynedit.subdir = libs/qsynedit
APP_NAME = RedPandaCPP APP_NAME = RedPandaCPP
APP_VERSION = 2.24 APP_VERSION = 2.25
# Add the dependencies so that the RedPandaIDE project can add the depended programs # Add the dependencies so that the RedPandaIDE project can add the depended programs
# into the main app bundle # into the main app bundle