- enhancement: auto insert a new line when input an enter between '(' and ')' or between '[' and ']'

This commit is contained in:
royqh1979@gmail.com 2021-10-29 15:37:30 +08:00
parent fde31ce7b5
commit 61a2ed4350
4 changed files with 16 additions and 19 deletions

View File

@ -1,6 +1,7 @@
Version 0.7.5 Version 0.7.5
- enhancement: more accurate auto indent calculation - enhancement: more accurate auto indent calculation
- change: remove "add indent" option in the editor general options widget ( It's merged with "auto indent" option) - change: remove "add indent" option in the editor general options widget ( It's merged with "auto indent" option)
- enhancement: auto insert a new line when input an enter between '(' and ')' or between '[' and ']'
Version 0.7.4 Version 0.7.4
- fix: when debug a project, and have breakpoints that not in opened editors, dev-cpp will crash - fix: when debug a project, and have breakpoints that not in opened editors, dev-cpp will crash

View File

@ -1,24 +1,16 @@
# RedPanda Dev-C++ 7 # RedPanda Dev-C++ 7
A light-weight C/C++ IDE based on Qt A light-weight C/C++ IDE based on Qt.
This project is the successor of Red Panda Dev-C++ 6. This project is the successor of Red Panda Dev-C++ 6.
Features implemented: All main features of version 6 have been ported.
* basic code editing (synedit)
* syntax highlight for C/C++ code
* symbol completion
* search/replace
* Compile & run
* debug
* code intellisense (auto completion)
* project support
New Features: New Features:
* code intellisense for unicode identifiers * Code intellisense for unicode identifiers
* Enhanced auto indent
* TODO view * TODO view
* memory view in the debug panel * Memory view in the debug panel
* code intellisense for clang (msys2 version) * Skip system header files when step into in debugging
* skip system header files when step into in debugging * Better color scheme support
* better color scheme support
* C++ 14 using type alias support * C++ 14 using type alias support
* some bug fixes for 6.7.5 * Code intellisense for clang (the msys2 version)

View File

@ -1991,7 +1991,11 @@ void SynEdit::insertLine(bool moveCaret)
mUndoList->AddChange(SynChangeReason::crLineBreak, caretXY(), caretXY(), rightLineText, mUndoList->AddChange(SynChangeReason::crLineBreak, caretXY(), caretXY(), rightLineText,
SynSelectionMode::smNormal); SynSelectionMode::smNormal);
//insert new line in middle of "{" and "}" //insert new line in middle of "{" and "}"
if (notInComment && leftLineText.endsWith('{') && rightLineText.startsWith('}')) { if (notInComment &&
( (leftLineText.endsWith('{') && rightLineText.startsWith('}'))
|| (leftLineText.endsWith('(') && rightLineText.startsWith(')'))
|| (leftLineText.endsWith('[') && rightLineText.startsWith(')'))
)) {
indentSpaces = calcIndentSpaces(mCaretY+1, "" , mOptions.testFlag(eoAutoIndent) indentSpaces = calcIndentSpaces(mCaretY+1, "" , mOptions.testFlag(eoAutoIndent)
&& notInComment); && notInComment);
indentSpacesForRightLineText = GetLeftSpacing(indentSpaces,true); indentSpacesForRightLineText = GetLeftSpacing(indentSpaces,true);

View File

@ -3,7 +3,7 @@
#include <QStringList> #include <QStringList>
#define DEVCPP_VERSION "0.7.4" #define DEVCPP_VERSION "0.7.5"
#define APP_SETTSINGS_FILENAME "redpandacpp.ini" #define APP_SETTSINGS_FILENAME "redpandacpp.ini"
#ifdef Q_OS_WIN #ifdef Q_OS_WIN