From e5b732753353b604250b7d8cf5a38c7527a8578f Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Mon, 30 Oct 2017 10:53:25 -0200 Subject: [PATCH] Double-clicking an include file name opens the IDE at the error line. When an error in an include file is reported, the IDE also shows what line inside the external file caused the error. Double-clicking the include line will open the file in a second instance of the IDE and position the cursor in the line that caused the last error. --- source/ide/ide_methods.bas | 6 +++++- source/qb64.bas | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index 5163ec22b..1e727873f 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -2706,7 +2706,11 @@ FUNCTION ide2 (ignore) PCOPY 3, 0 _DELAY .2 - SHELL QuotedFilename$(COMMAND$(0)) + " " + QuotedFilename$(f$) + p$ = QuotedFilename$(COMMAND$(0)) + " " + QuotedFilename$(f$) + IF errorLineInInclude > 0 AND idefocusline = idecy THEN + p$ = p$ + " -l:" + str2$(errorLineInInclude) + END IF + SHELL p$ IF IDE_AutoPosition THEN WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoPosition", "TRUE" diff --git a/source/qb64.bas b/source/qb64.bas index dbee22487..34d495f76 100644 --- a/source/qb64.bas +++ b/source/qb64.bas @@ -338,7 +338,7 @@ DIM SHARED idemessage AS STRING 'set by qb64-error(...) to the error message to DIM SHARED optionexplicit AS _BYTE DIM SHARED optionexplicit_cmd AS _BYTE -DIM SHARED ideStartAtLine AS LONG +DIM SHARED ideStartAtLine AS LONG, errorLineInInclude AS LONG DIM SHARED outputfile_cmd$ DIM SHARED compilelog$ @@ -1500,6 +1500,7 @@ layout = "" layoutok = 0 NoChecks = 0 inclevel = 0 +errorLineInInclude = 0 addmetainclude$ = "" nextrunlineindex = 1 lasttype = 0 @@ -2783,6 +2784,7 @@ DO wholeline$ = x$ inclinenumber(inclevel) = inclinenumber(inclevel) + 1 'create extended error string 'incerror$' + errorLineInInclude = inclinenumber(inclevel) e$ = " in line " + str2(inclinenumber(inclevel)) + " of " + incname$(inclevel) + " included" IF inclevel > 1 THEN e$ = e$ + " (through " @@ -10721,6 +10723,7 @@ DO continuelinefrom = 0 inclinenumber(inclevel) = inclinenumber(inclevel) + 1 'create extended error string 'incerror$' + errorLineInInclude = inclinenumber(inclevel) e$ = " in line " + str2(inclinenumber(inclevel)) + " of " + incname$(inclevel) + " included" IF inclevel > 1 THEN e$ = e$ + " (through "