Skip to content

Commit 184ebe0

Browse files
committed
don't show the CodeBrowserModule IM in release mode
Add IsProcGlobal(...) convenience function
1 parent abdbeea commit 184ebe0

3 files changed

Lines changed: 21 additions & 9 deletions

File tree

procedures/CodeBrowser.ipf

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ Function/S interpretParamType(ptype, paramOrReturn)
108108
typeStr += "/U"
109109
endif
110110

111-
if(debuggingEnabled)
112-
string msg
113-
sprintf msg, "type:%d, str:%s", ptype, typeStr
114-
debugPrint(msg)
115-
endif
111+
// if(debuggingEnabled)
112+
// string msg
113+
// sprintf msg, "type:%d, str:%s", ptype, typeStr
114+
// debugPrint(msg)
115+
// endif
116116

117117
return typeStr
118118
endif
@@ -447,13 +447,19 @@ Function/S getProcWindows(regexp,options)
447447
return SortList(procListClean,";",4)
448448
End
449449

450-
// Returns a list of independent modules including ProcGlobal but skipping WM modules
450+
// Returns a list of independent modules
451+
// Includes ProcGlobal but skips all WM modules and the current module in release mode
451452
Function/S getModuleList()
452453

453454
string moduleList
454455

455456
moduleList = IndependentModuleList(";")
456457
moduleList = ListMatch(moduleList,"!WM*",";") // skip WM modules
458+
string module = GetIndependentModuleName()
459+
460+
if(!debuggingEnabled && !isProcGlobal(module))
461+
moduleList = ListMatch(moduleList,"!" + module,";") // skip current module
462+
endif
457463
moduleList = "ProcGlobal;" + SortList(moduleList)
458464

459465
return moduleList
@@ -525,7 +531,7 @@ End
525531
Function/S getProcList(module)
526532
string module
527533

528-
if( cmpstr(module,"ProcGlobal") == 0 )
534+
if( isProcGlobal(module) )
529535
return getGlobalProcWindows()
530536
else
531537
return getIMProcWindows(module)

procedures/CodeBrowser_gui.ipf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Function/S getCurrentItem([module, procedure, procedureWithSuffix, procedureWith
163163
if(procedureWithModule)
164164
string moduleName = getCurrentItem(module=1)
165165
// work around FunctionList not accepting Procedure.ipf [ProcGlobal]
166-
if(cmpstr(moduleName,"ProcGlobal") == 0 && cmpstr(windowName,"Procedure") == 0)
166+
if(isProcGlobal("ProcGlobal") && cmpstr(windowName,"Procedure") == 0)
167167
return windowName + " [" + moduleName + "]"
168168
else
169169
return windowName + ".ipf [" + moduleName + "]"

procedures/CodeBrowser_utils.ipf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ Function isEmpty(str)
1313
return !(strlen(str) > 0)
1414
End
1515

16+
Function isProcGlobal(module)
17+
string module
18+
19+
return cmpstr(module,"ProcGlobal") == 0
20+
End
21+
1622
// Returns the dimension of the first screen
1723
Function GetScreenDimensions(rect)
1824
STRUCT RECT &rect
@@ -48,7 +54,7 @@ Function debugPrint(msg)
4854
string msg
4955

5056
if(debuggingEnabled)
51-
printf "%s(...): %s\r", GetRTStackInfo(2), msg
57+
printf "%s(...): %s\r", GetRTStackInfo(2), RemoveEnding(msg,"\r")
5258
endif
5359
End
5460

0 commit comments

Comments
 (0)