Update: Output panels are inconsistent. By default they actually do have is_widget
set, but sometimes they do not. Notably, the “exec” panel after a build was performed:
>>> exec = window.create_output_panel("exec")
>>> exec.settings().get('is_widget')
True
>>> sublime.log_commands(True)
command: build
Running python -u "C:\some\file.py"
command: show_panel {"panel": "console", "toggle": true}
>>> exec.settings().get('is_widget')
The LaTeXTools package build system, which re-uses the “exec” output panel for its custom build command, does not unset the is_widget
setting.
I could narrow it down to self.output_view.assign_syntax()
being the culprit, as that seemingly turns the output panel into a “real view”, which also sets the gutter and other settings by default, which is why in exec.py
most of these settings are explicitly disabled (notably gutter
and line_numbers
).
… Why?
I would also like to have an explanation for these comments:
if not hasattr(self, 'output_view'):
# Try not to call get_output_panel until the regexes are assigned
self.output_view = self.window.create_output_panel("exec")
[...]
# Call create_output_panel a second time after assigning the above
# settings, so that it'll be picked up as a result buffer
self.window.create_output_panel("exec")
The settings are also not reset upon calling create_output_panel
again, despite all content being erased.