Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window commands fail to run when console panel is open #2014

Closed
gerardroche opened this issue Oct 20, 2017 · 1 comment
Closed

Window commands fail to run when console panel is open #2014

gerardroche opened this issue Oct 20, 2017 · 1 comment

Comments

@gerardroche
Copy link

If the console panel is open or if you open it immediately after start, then any commands that are run inside, for example, the plugin_loaded() event are back-holed i.e. noop'd.

This impacts a lot of plugins and can be cause of many hard to reproduce bugs because they tend to bugs that only happen sometimes i.e. you need to discover what is happening to reproduce it.

Steps to reproduce

Create a plugin, let's say User/marvin.py:

import sublime
import sublime_plugin

class MarvinCommand(sublime_plugin.WindowCommand):
    def run(self):
        print('[Marvin] Marvin.run()')

def plugin_loaded():
    print('[Marvin] plugin_loaded()')

    window = sublime.active_window()
    print(window, window.id())

    print('[Marvin] plugin_loaded() running marvin...')
    window.run_command('marvin')
    print('[Marvin] plugin_loaded() running marvin DONE')
  • Close ST
  • Start ST.
  • Immediately upon starting ST: open the console panel. Use the keymap to do it quickly, Ctrl+` on Linux.

Expected

...
plugins loaded
[Marvin] plugin_loaded()
<sublime.Window object at 0x7fb89e29aed0> 2
[Marvin] plugin_loaded() running marvin...
[Marvin] Marvin.run()
[Marvin] plugin_loaded() running marvin DONE

Actual

...
plugins loaded
[Marvin] plugin_loaded()
<sublime.Window object at 0x7fe78a49ffd0> 2
[Marvin] plugin_loaded() running marvin...
[Marvin] plugin_loaded() running marvin DONE

Notice the marvin command is not run.

Environment

  • Linux (Ubuntu 17.04)
  • ST 3151
@wbond
Copy link
Member

wbond commented Nov 1, 2017

This was fixed in build 3153

@wbond wbond closed this as completed Nov 1, 2017
@wbond wbond added the R: fixed label Nov 1, 2017
@wbond wbond added this to the Build 3153 milestone Nov 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants