mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-01 12:40:36 +00:00
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.
This commit is contained in:
parent
5846305079
commit
24c65558f0
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue