- fix: one line 'while' statement dosen't correctly indents

- fix: line starts with  '{' that follow an un-ended 'if'/'for' statement is not correctly un-indented
This commit is contained in:
royqh1979 2021-11-06 23:21:52 +08:00
parent 2dc8896fbe
commit 6e4afe83c0
3 changed files with 5 additions and 2 deletions

View File

@ -10,6 +10,8 @@ Version 0.8.1 For Dev-C++ 7 Beta
- fix: if the proceeding line ends with ':' in comments, current line should not indent - fix: if the proceeding line ends with ':' in comments, current line should not indent
- enhancement: right click the problem set name label to rename it - enhancement: right click the problem set name label to rename it
- change: memory view and locals view use debug console's font settings - change: memory view and locals view use debug console's font settings
- fix: one line 'while' statement dosen't correctly indents
- fix: line start with '{' that follow an un-ended 'if'/'for' statement is not correctly un-indented
Version 0.8 For Dev-C++ 7 Beta Version 0.8 For Dev-C++ 7 Beta
- fix: find in the current file is not correcly saved in the search history - fix: find in the current file is not correcly saved in the search history

View File

@ -1440,7 +1440,7 @@ int SynEdit::calcIndentSpaces(int line, const QString& lineText, bool addIndent)
QVector<int> matchingIndents; QVector<int> matchingIndents;
int l; int l;
if (attr == mHighlighter->symbolAttribute() if (attr == mHighlighter->symbolAttribute()
&& firstToken == '}' ) { && (firstToken == '}' || firstToken == '{')) {
matchingIndents = rangeAfterFirstToken.matchingIndents; matchingIndents = rangeAfterFirstToken.matchingIndents;
dontAddIndent = true; dontAddIndent = true;
l = startLine; l = startLine;

View File

@ -8,7 +8,8 @@ static const QSet<QString> StatementKeyWords {
"for", "for",
"try", "try",
"catch", "catch",
"else" "else",
"while"
}; };