-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
Actual behavior
The hide_panel event is not called by the enter key, when it is pressed on the current panel, causing it to close.
Steps to reproduce
-
Create the package
bug.pyon yourUserfolder.import sublime, sublime_plugin class HidePanelBugListener(sublime_plugin.EventListener): def on_post_window_command(self, window, command, args): if command == "hide_panel": print( "on_post_window_command hide_panel" ) def on_cancel(): print( "Cancelling" ) pass def on_done(self): print( "Done" ) def on_change(self): print( "Change" ) pass class HidePanelBugCommand(sublime_plugin.WindowCommand): def run(self): sublime.active_window().show_input_panel( \ "To bug it, press enter: ", "", on_done, on_change, on_cancel )
-
Open Sublime Text console
Ctrl+'and run the command
sublime.active_window().run_command( "hide_panel_bug" ) -
If you press
enter, you will get the output:>>> sublime.active_window().run_command( "hide_panel_bug" ) Change Done -
If you press
escape, you will get the output:>>> sublime.active_window().run_command( "hide_panel_bug" ) Change on_post_window_command hide_panel Cancelling
Expected behavior
When I open the input panel I am expecting to receive the hide_panel event when it is closed, either by the escape key, either by the enter key.
-
If you press
enter, you will get the output:>>> sublime.active_window().run_command( "hide_panel_bug" ) Change on_post_window_command hide_panel Done -
If you press
escape, you will get the output:>>> sublime.active_window().run_command( "hide_panel_bug" ) Change on_post_window_command hide_panel Cancelling
Environment
- Operating system and version:
- Windows 10 build 15063
- Mac OS ...
- Linux ...
- Monitor:
- Resolution 1920x1080
dpi_scaleused in ST 1.0
- Sublime Text:
- Build 3141
- 32 bit
Related issues:
- Input panel closes when completions visible and press enter #1727 Input panel closes when completions visible and press enter
evandrocoan, gerardroche and zekexiao