- fix: Symbol completion of '(' before selection may fail, if cursor is at the beginning of the selection.

This commit is contained in:
Roy Qu 2023-08-23 20:47:23 +08:00
parent 10c134a5c7
commit ee26d9d0a0
2 changed files with 13 additions and 10 deletions

View File

@ -1,6 +1,6 @@
Red Panda C++ Version 2.25
- change: Symbol completion of '(' won't test current character at the cursor.
- fix: Symbol completion of '(' before selection may fail, if cursor is at the beginning of the selection.
- change: Symbol completion of '{' won't insert extra new lines.
Red Panda C++ Version 2.24

View File

@ -1017,17 +1017,20 @@ void Editor::keyPressEvent(QKeyEvent *event)
case '*':
case ';':
case ',':
case '(':
handled = handleSymbolCompletion(ch);
return;
// QChar nextCh;
// if (selAvail()) {
// nextCh = nextNonSpaceChar(caretY()-1,caretX()-1);
// } else {
// nextCh = nextNonSpaceChar(caretY()-1,caretX()-1);
// }
// if (!isIdentChar(nextCh) && nextCh!='('
// && nextCh!='"' && nextCh!='\'' ){
case '(': {
if (!selAvail()) {
QChar nextCh = nextNonSpaceChar(caretY()-1,caretX()-1);
if (!isIdentChar(nextCh) && nextCh!='('
&& nextCh!='"' && nextCh!='\'' ){
handled = handleSymbolCompletion(ch);
}
} else {
handled = handleSymbolCompletion(ch);
}
return;
}
case '<':
case '>':
if (mParser) {