Search code examples
zerobrane

ZeroBrane Studio - Setting/plugin to contextually hide/show Output/Local console menus


I often use ZeroBrane Studio when working with Lua, and it works great! But there's one customization I'd like to make to the IDE that I can't quite figure out how to achieve. My end goal is to:

  • have the Output/Local console menus hidden when not executing the program/debugging/running as Scratchpad (this part is already possible via the View toolbar)
  • have them shown while doing those tasks (likewise, this is already the default behavior)
  • but then have them re-hide once I am no longer doing one of those tasks (the tricky part)

In other words, these menus would only be displayed when the program is running. I suspect I'm going to need a simple plugin for this, but I'm still stumbling my way through the plugin API and figured it might just be simpler to ask here. Apologies in advance if this has been answered elsewhere or if a plugin exists for this- I couldn't find these if so. And thanks!


Solution

  • You do have a couple of options to consider, but none of them may be doing exactly what you're looking for.

    1. You can disable activateoutput (add activateoutput = false to the config), which will change debugging to rely on its default toggle-view functionality. You can then "hide" the Output panel and "show" it during debugging. It will "remember" that behavior (for the current session) and will be automatically showing and hiding the panel when the debugging is used. Unfortunately, this is not going to happen automatically during Run, so you'll have to do it manually.

    2. You can also use OnDebuggerLoad and OnDebuggerClose events to show/hide the output panel as needed, but those events are not triggered during Run either.

    If none of this works, I may consider adding two more events when commands are executed to catch/handle these events, but the main issue is that it's going to be triggered on any events, not necessarily those that are limited to Run commands.