From 24c65558f0324c8cd4b5d14c68ce11a7e6bf7bea Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Tue, 29 Dec 2015 02:16:34 -0200 Subject: [PATCH] EDIT: Changed the code to also check that END SUB/END FUNCTION can be found after the current line, which eliminates the possibility of making the IDE believe that we are in a SUB/FUNCTION when we are actually just past the last one in the file. --- source/ide/ide_methods.bas | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index c306e06bd..2540ed405 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -691,6 +691,19 @@ DO ELSE sfname$ = thisline$ END IF + + 'But what if we're past the end of this module's SUBs and FUNCTIONs, + 'and all that's left is a bunch of comments or $INCLUDES? + 'We'll also check for that: + for endSF_CHECK = idecy to iden + thisline$ = idegetline(endSF_CHECK) + thisline$ = LTRIM$(RTRIM$(thisline$)) + endedSF = 0 + ncthisline$ = UCASE$(thisline$) + IF LEFT$(ncthisline$, 7) = "END SUB" THEN endedSF = 1: EXIT FOR + IF LEFT$(ncthisline$, 12) = "END FUNCTION" THEN endedSF = 2: EXIT FOR + next + if endedSF = 0 then sfname$ = "" EXIT FOR END IF NEXT