Skip to content

Commit 0a0a3e6

Browse files
author
Matthias Kastner
committed
always load saved results when in uncompiled state
Previously, when a Procedure was in uncompiled state, it checksum differed from the last known compile-state and therefore was marked for re-parsing. As `FunctionList` relies on a compiled procedure, the functionlist was left empty. This left CodeBrowser unusable when in an uncompiled state. This change skips checksum comparison when in uncompiled state and loads the procedure from the save waves. As a consequence, the procedure's mark is left in an invalid state.
1 parent 8c62e2d commit 0a0a3e6

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

procedures/CodeBrowser.ipf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ static Function saveLoad(procedure)
678678
// if maximum storage capacity was reached (procedure.row == -1) or Element not found (procedure.row == endofWave) there is nothing to load.
679679
debugPrint("save state not found")
680680
return -1
681-
elseif(SaveVariablesWave[procedure.row][0] == 0)
681+
elseif(isCompiled() && !SaveVariablesWave[procedure.row][0])
682682
// procedure marked as non valid by AfterRecompileHook
683683
// checksum needs to be compared.
684684

procedures/CodeBrowser_utils.ipf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,3 +279,22 @@ Function timerStop(timerRefNum)
279279
microseconds = stopMSTimer(timerRefNum)
280280
return microseconds
281281
End
282+
283+
// check if procedures are in compiled state.
284+
//
285+
// @param funcList [optional] input FunctionList to save time
286+
//
287+
// @return 0 if procedure is not compiled, 1 otherwise
288+
Function isCompiled([funcList])
289+
string funcList
290+
291+
if(ParamIsDefault(funcList))
292+
funcList = FunctionList("*", ";", "KIND:18,WIN:Procedure [ProcGlobal]")
293+
endif
294+
295+
if(!cmpstr(funclist, "Procedures Not Compiled;"))
296+
debugPrint("procedures are in uncompiled state.")
297+
return 0
298+
endif
299+
return 1
300+
End

0 commit comments

Comments
 (0)