Skip to content

Commit

Permalink
Merge branch 'master' of github.com:royqh1979/RedPanda-CPP
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy Qu committed Apr 25, 2023
2 parents 4020525 + 9275f97 commit b93dac4
Show file tree
Hide file tree
Showing 19 changed files with 454 additions and 333 deletions.
11 changes: 11 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Red Panda C++ Version 2.21

- change: The option "Check for stack smashing attacks (-fstack-protector)" is turned off by default in the Debug compiler set settings.
- fix: Project makefile generated for C files is not correct.
- fix: Horizontal scroll by touchpad is not working.
- fix: Horizontal scroll by touchpad is inversed.
- fix: Error message when save bookmarks.
- enhancement: Auto skip ; and , when input.
- enhancement: Add 'characters' column in the file properties dialog.
- enhancement: Just keeping two digits after the decimal point for file size in the file properties dialog.

Red Panda C++ Version 2.20

- change: Remove the compiler set option "Syntax error when object larger than"
Expand Down
2 changes: 1 addition & 1 deletion RedPandaIDE/RedPandaIDE.pro
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ isEmpty(APP_NAME) {
}

isEmpty(APP_VERSION) {
APP_VERSION = 2.20
APP_VERSION = 2.21
}

contains(QMAKE_HOST.arch, x86_64):{
Expand Down
4 changes: 2 additions & 2 deletions RedPandaIDE/compiler/projectcompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,12 @@ void ProjectCompiler::writeMakeObjFilesRules(QFile &file)
}
}

if (fileType==FileType::CppSource || fileType==FileType::CppSource) {
if (fileType==FileType::CSource || fileType==FileType::CppSource) {
if (mOnlyCheckSyntax) {
if (unit->compileCpp())
writeln(file, "\t$(CPP) -c " + genMakePath1(shortFileName) + " $(CXXFLAGS) " + encodingStr);
else
writeln(file, "\t(CC) -c " + genMakePath1(shortFileName) + " $(CFLAGS) " + encodingStr);
writeln(file, "\t$(CC) -c " + genMakePath1(shortFileName) + " $(CFLAGS) " + encodingStr);
} else {
if (unit->compileCpp())
writeln(file, "\t$(CPP) -c " + genMakePath1(shortFileName) + " -o " + objFileName2 + " $(CXXFLAGS) " + encodingStr);
Expand Down
8 changes: 7 additions & 1 deletion RedPandaIDE/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,13 @@ void Debugger::save(const QString &filename, const QString& projectFolder)
foreach (const PWatchVar& watchVar, watchVars) {
watchVarCompareSet.insert(watchVar->expression);
}
std::shared_ptr<DebugConfig> pConfig = load(filename, forProject);
std::shared_ptr<DebugConfig> pConfig;
try {
pConfig = load(filename, forProject);
} catch (FileError& e) {

}

QFile file(filename);
if (file.open(QFile::WriteOnly | QFile::Truncate)) {
foreach (const PBreakpoint& breakpoint, pConfig->breakpoints) {
Expand Down
39 changes: 39 additions & 0 deletions RedPandaIDE/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,8 @@ void Editor::keyPressEvent(QKeyEvent *event)
case ']':
case '<':
case '*':
case ';':
case ',':
handled = handleSymbolCompletion(ch);
return;
case '(': {
Expand Down Expand Up @@ -2561,6 +2563,20 @@ bool Editor::handleSymbolCompletion(QChar key)
return handleGlobalIncludeSkip();
}
return false;
case ';':
if (selAvail())
return false;
if (pSettings->editor().overwriteSymbols()) {
return handleSemiColonSkip();
}
return false;
case ',':
if (selAvail())
return false;
if (pSettings->editor().overwriteSymbols()) {
return handlePeriodSkip();
}
return false;
}
return false;
}
Expand Down Expand Up @@ -2758,6 +2774,29 @@ bool Editor::handleBraceSkip()
return false;
}

bool Editor::handleSemiColonSkip()
{
if (getCurrentChar() != ';')
return false;
bool oldInsertMode = insertMode();
setInsertMode(false); //set mode to overwrite
processCommand(QSynedit::EditCommand::Char,';');
setInsertMode(oldInsertMode);
return true;
}

bool Editor::handlePeriodSkip()
{
if (getCurrentChar() != ',')
return false;

bool oldInsertMode = insertMode();
setInsertMode(false); //set mode to overwrite
processCommand(QSynedit::EditCommand::Char,',');
setInsertMode(oldInsertMode);
return true;
}

bool Editor::handleSingleQuoteCompletion()
{
QuoteStatus status = getQuoteStatus();
Expand Down
2 changes: 2 additions & 0 deletions RedPandaIDE/editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ private slots:
bool handleMultilineCommentCompletion();
bool handleBraceCompletion();
bool handleBraceSkip();
bool handleSemiColonSkip();
bool handlePeriodSkip();
bool handleSingleQuoteCompletion();
bool handleDoubleQuoteCompletion();
bool handleGlobalIncludeCompletion();
Expand Down
3 changes: 2 additions & 1 deletion RedPandaIDE/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2748,7 +2748,8 @@ static void setDebugOptions(Settings::PCompilerSet pSet, bool enableAsan = false
// pSet->setCustomLinkParams("-fsanitize=address");
// pSet->setUseCustomLinkParams(true);
}
pSet->setCompileOption(CC_CMD_OPT_STACK_PROTECTOR, "-strong");
//Some windows gcc don't correctly support this
//pSet->setCompileOption(CC_CMD_OPT_STACK_PROTECTOR, "-strong");
pSet->setStaticLink(false);

}
Expand Down
10 changes: 5 additions & 5 deletions RedPandaIDE/translations/RedPandaIDE_pt_BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -757,11 +757,7 @@
</message>
<message>
<source>MB</source>
<translation type="unfinished">MB</translation>
</message>
<message>
<source>Syntax error for stack frame larger than</source>
<translation type="unfinished"></translation>
<translation type="obsolete">MB</translation>
</message>
</context>
<context>
Expand Down Expand Up @@ -2215,6 +2211,10 @@
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>Characters:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FormatterGeneralWidget</name>
Expand Down
Loading

0 comments on commit b93dac4

Please sign in to comment.