- fix: Compile info for project doesn't have name of the project executable.

- fix: Select a word in string / comment doesn't highlight other words in the file
This commit is contained in:
Roy Qu 2024-03-28 10:16:28 +08:00
parent 76d3e3d6e2
commit e58adc94ff
4 changed files with 18 additions and 14 deletions

View File

@ -102,6 +102,7 @@ Red Panda C++ Version 2.27
- fix: "0x3.12p+1" is treadted as a plus expression when reformatting code. ( by 绣球135@qq
- change: Don't turn on the code format option "indent class" by default.
- enhancement: Add compiler set by choose the executable.
- fix: Compile info for project doesn't have name of the project executable.
Red Panda C++ Version 2.26
- enhancement: Code suggestion for embedded std::vectors.

View File

@ -171,7 +171,7 @@ void ProjectCompiler::writeMakeHeader(QFile &file)
void ProjectCompiler::writeMakeDefines(QFile &file, bool &genModuleDef)
{
// Get list of object files
QStringList Objects;
QStringList objects;
QStringList LinkObjects;
QStringList cleanObjects;
QStringList moduleDefines;
@ -192,13 +192,13 @@ void ProjectCompiler::writeMakeDefines(QFile &file, bool &genModuleDef)
QString fullObjFile = includeTrailingPathDelimiter(mProject->options().objectOutput)
+ extractFileName(unit->fileName());
QString relativeObjFile = extractRelativePath(mProject->directory(), changeFileExt(fullObjFile, OBJ_EXT));
Objects << relativeObjFile;
objects << relativeObjFile;
cleanObjects << localizePath(relativeObjFile);
if (unit->link()) {
LinkObjects << relativeObjFile;
}
} else {
Objects << changeFileExt(relativeName, OBJ_EXT);
objects << changeFileExt(relativeName, OBJ_EXT);
cleanObjects << localizePath(changeFileExt(relativeName, OBJ_EXT));
if (unit->link())
LinkObjects << changeFileExt(relativeName, OBJ_EXT);
@ -253,7 +253,7 @@ void ProjectCompiler::writeMakeDefines(QFile &file, bool &genModuleDef)
QString executable = extractRelativePath(mProject->makeFileName(), mProject->executable());
QString cleanExe = localizePath(executable);
QString pchH = extractRelativePath(mProject->makeFileName(), mProject->options().precompiledHeader);
QString pchHeader = extractRelativePath(mProject->makeFileName(), mProject->options().precompiledHeader);
QString pch = extractRelativePath(mProject->makeFileName(), mProject->options().precompiledHeader + "." GCH_EXT);
// programs
@ -278,14 +278,14 @@ void ProjectCompiler::writeMakeDefines(QFile &file, bool &genModuleDef)
// do not use them in targets or command arguments, they have different escaping rules
if (!objResFile.isEmpty()) {
writeln(file, "RES = " + escapeFilenameForMakefilePrerequisite(objResFile));
writeln(file, "OBJ = " + escapeFilenamesForMakefilePrerequisite(Objects) + " $(RES)");
writeln(file, "OBJ = " + escapeFilenamesForMakefilePrerequisite(objects) + " $(RES)");
} else {
writeln(file, "OBJ = " + escapeFilenamesForMakefilePrerequisite(Objects));
writeln(file, "OBJ = " + escapeFilenamesForMakefilePrerequisite(objects));
};
writeln(file, "BIN = " + escapeFilenameForMakefilePrerequisite(executable));
if (mProject->options().usePrecompiledHeader
&& fileExists(mProject->options().precompiledHeader)){
writeln(file, "PCH_H = " + escapeFilenameForMakefilePrerequisite(pchH));
writeln(file, "PCH_H = " + escapeFilenameForMakefilePrerequisite(pchHeader));
writeln(file, "PCH = " + escapeFilenameForMakefilePrerequisite(pch));
}
@ -625,6 +625,8 @@ bool ProjectCompiler::prepareForCompile()
}
mDirectory = mProject->directory();
mOutputFile = mProject->executable();
log(tr("Processing makefile:"));
log("--------");
log(tr("- makefile processer: %1").arg(mCompiler));

View File

@ -341,6 +341,7 @@ bool SDCCProjectCompiler::prepareForCompile()
}
mDirectory = mProject->directory();
mOutputFile = mProject->executable();
log(tr("Processing makefile:"));
log("--------");
log(tr("- makefile processer: %1").arg(mCompiler));

View File

@ -1875,22 +1875,22 @@ void Editor::onStatusChanged(QSynedit::StatusChanges changes)
// scSelection includes anything caret related
if (changes.testFlag(QSynedit::StatusChange::scSelection)) {
QString token;
QSynedit::PTokenAttribute attri;
if (getTokenAttriAtRowCol(caretXY(), token,attri)
if (!selAvail() && pSettings->editor().highlightCurrentWord()) {
QString token;
QSynedit::PTokenAttribute attri;
if (getTokenAttriAtRowCol(caretXY(), token,attri)
&& (
(attri->tokenType()==QSynedit::TokenType::Identifier)
|| (attri->tokenType() == QSynedit::TokenType::Keyword)
|| (attri->tokenType() == QSynedit::TokenType::Preprocessor)
)) {
if (!selAvail() && pSettings->editor().highlightCurrentWord()) {
mCurrentHighlightedWord = token;
} else if (selAvail() && blockBegin() == wordStart()
&& blockEnd() == wordEnd()){
mCurrentHighlightedWord = selText();
} else {
mCurrentHighlightedWord = "";
}
} else if (selAvail() && blockBegin() == wordStart()
&& blockEnd() == wordEnd()){
mCurrentHighlightedWord = selText();
} else {
mCurrentHighlightedWord = "";
}