Skip to content

Commit

Permalink
- Enhancement: When '{' is inputted and there are contents selected, …
Browse files Browse the repository at this point in the history
…auto add line breaks and indents.
  • Loading branch information
royqh1979 committed Feb 29, 2024
1 parent ee48838 commit 7c37950
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion RedPandaIDE/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2826,7 +2826,8 @@ bool Editor::handleBraceCompletion()
} else if (oldSelEnd.ch > trimRight(s2).length()) {
shouldBreakLine = true;
}
shouldAddEndLine = !s2.mid(oldSelEnd.ch).trimmed().isEmpty();
if (shouldBreakLine)
shouldAddEndLine = !s2.mid(oldSelEnd.ch).trimmed().isEmpty();
}
if (shouldBreakLine) {
text = "{" + lineBreak() + text;
Expand Down

0 comments on commit 7c37950

Please sign in to comment.