diff --git a/RedPandaIDE/compiler/compiler.cpp b/RedPandaIDE/compiler/compiler.cpp index 873576fc..2374e96c 100644 --- a/RedPandaIDE/compiler/compiler.cpp +++ b/RedPandaIDE/compiler/compiler.cpp @@ -334,7 +334,7 @@ QString Compiler::getCppIncludeArguments() return result; } -QString Compiler::getLibraryArguments() +QString Compiler::getLibraryArguments(FileType fileType) { QString result; @@ -344,7 +344,8 @@ QString Compiler::getLibraryArguments() //Add auto links // is file and auto link enabled - { + if (fileType == FileType::CSource || + fileType == FileType::CppSource){ Editor* editor = pMainWindow->editorList()->getEditor(); if (editor) { PCppParser parser = editor->parser(); @@ -359,12 +360,12 @@ QString Compiler::getLibraryArguments() QApplication *app=dynamic_cast( QApplication::instance()); app->processEvents(); - QSet parsedFiles; - result += parseFileIncludesForAutolink( - editor->filename(), - parsedFiles, - parser); } + QSet parsedFiles; + result += parseFileIncludesForAutolink( + editor->filename(), + parsedFiles, + parser); } } @@ -461,7 +462,7 @@ void Compiler::runCommand(const QString &cmd, const QString &arguments, const Q if (errorOccurred) { switch (process.error()) { case QProcess::FailedToStart: - throw CompileError(tr("The compiler process failed to start.")); + throw CompileError(tr("The compiler process for '%1' failed to start.").arg(mFilename)); break; case QProcess::Crashed: if (!mStop) diff --git a/RedPandaIDE/compiler/compiler.h b/RedPandaIDE/compiler/compiler.h index d5bf97d5..fe7fc995 100644 --- a/RedPandaIDE/compiler/compiler.h +++ b/RedPandaIDE/compiler/compiler.h @@ -49,7 +49,7 @@ protected: virtual QString getCppCompileArguments(bool checkSyntax); virtual QString getCIncludeArguments(); virtual QString getCppIncludeArguments(); - virtual QString getLibraryArguments(); + virtual QString getLibraryArguments(FileType fileType); virtual QString parseFileIncludesForAutolink( const QString& filename, QSet parsedFiles, diff --git a/RedPandaIDE/compiler/filecompiler.cpp b/RedPandaIDE/compiler/filecompiler.cpp index 68679b0f..70218463 100644 --- a/RedPandaIDE/compiler/filecompiler.cpp +++ b/RedPandaIDE/compiler/filecompiler.cpp @@ -61,7 +61,7 @@ bool FileCompiler::prepareForCompile() default: throw CompileError(tr("Can't find the compiler for file %1").arg(mFilename)); } - mArguments += getLibraryArguments(); + mArguments += getLibraryArguments(fileType); if (!QFile(mCompiler).exists()) { throw CompileError(tr("The Compiler '%1' doesn't exists!").arg(mCompiler)); diff --git a/RedPandaIDE/compiler/stdincompiler.cpp b/RedPandaIDE/compiler/stdincompiler.cpp index 72c8008b..18cea234 100644 --- a/RedPandaIDE/compiler/stdincompiler.cpp +++ b/RedPandaIDE/compiler/stdincompiler.cpp @@ -50,7 +50,7 @@ bool StdinCompiler::prepareForCompile() default: throw CompileError(tr("Can't find the compiler for file %1").arg(mFilename)); } - mArguments += getLibraryArguments(); + mArguments += getLibraryArguments(fileType); if (!QFile(mCompiler).exists()) { throw CompileError(tr("The Compiler '%1' doesn't exists!").arg(mCompiler)); diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index 4d1746c9..b44fd75a 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -498,6 +498,7 @@ QSet CppParser::getFileDirectIncludes(const QString &filename) while (iter != fileIncludes->includeFiles.cend()) { if (iter.value()) list.insert(iter.key()); + iter++; } } return list; diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp index 7d2a904c..3d947f75 100644 --- a/RedPandaIDE/qsynedit/SynEdit.cpp +++ b/RedPandaIDE/qsynedit/SynEdit.cpp @@ -1242,7 +1242,7 @@ BufferCoord SynEdit::WordEndEx(const BufferCoord &XY) // valid line? if ((CY >= 1) && (CY <= mLines->count())) { QString Line = mLines->getString(CY - 1); - if (CX <= Line.length()) { + if (CX <= Line.length() && CX-2>=0) { if (isWordChar(Line[CX - 2])) CX = StrScanForNonWordChar(Line, CX); if (CX == 0) diff --git a/RedPandaIDE/resources/autolink.json b/RedPandaIDE/resources/autolink.json index 8380bc7e..67ee3ade 100644 --- a/RedPandaIDE/resources/autolink.json +++ b/RedPandaIDE/resources/autolink.json @@ -1,9 +1,9 @@ [{ "header": "ege.h", - "links": ["-lgraphics -luuid -lmsimg32 -lgdi32 -limm32 -lole32 -loleaut32 -lwinmm -lgdiplus"] + "links": "-lgraphics -luuid -lmsimg32 -lgdi32 -limm32 -lole32 -loleaut32 -lwinmm -lgdiplus" }, { "header": "turtle.h", - "links": ["-lturtle"] + "links": "-lturtle" } -] \ No newline at end of file +]