SublimeText / Origami

Split the window however you like! Create new panes, delete panes, move and clone views from pane to pane.
MIT License
1.21k stars 82 forks source link

Then try to close the last item in pane, Sublime Text will crash #158

Closed pelemarse closed 3 years ago

pelemarse commented 3 years ago

If Settings is set to "origami_auto_close_empty_panes": true and try to close the last item, Sublime Text will crash.

Origami 2.2.0 Sublime Text 4 dev 4102

https://user-images.githubusercontent.com/29234307/114958378-89788b80-9e6b-11eb-936a-4755edd940b7.mp4

rchl commented 3 years ago

Would suggest reporting at https://github.com/sublimehq/sublime_text

ST should never crash, no matter what plugin does.

rchl commented 3 years ago

I've tried this but it doesn't reproduce for me in safe mode:

https://user-images.githubusercontent.com/153197/115072638-1b2dda80-9ef8-11eb-8eec-9d17728ee9ea.mov

Maybe there is something extra in your setup that causes this to trigger.

(It didn't crash on closing the last tab BTW. The window was only hidden.)

pelemarse commented 3 years ago

Ok. I found that the program crashes when more than one file is opened.

https://user-images.githubusercontent.com/29234307/115083497-1ecd5b80-9f10-11eb-861c-31befe518726.mov

rchl commented 3 years ago

Still can't reproduce. Can you actually reproduce it in safe mode (cmd+click the ST icon)? You are using some terminal package here which could play a role.

rchl commented 3 years ago

Actually reproduced now. Had to close the tab in the bottom pane with a mouse click rather than cmd+w.

So the steps are:

  1. Open in safe mode
  2. Install package control and origami package
  3. Set "origami_auto_close_empty_panes": true, in global preferences
  4. Open two tabs
  5. Press cmd+k, down to create the bottom pane
  6. Open a new file in the bottom pane
  7. Close the newly opened file by clicking the 'X' with the mouse
rchl commented 3 years ago

As far as Origami, it does something like this (don't have time to minimize):

class AutoCloseEmptyPanes(sublime_plugin.EventListener):
  def on_pre_close(self, view):
    sublime.set_timeout(lambda: window.run_command("destroy_pane"), 0)

class DestroyPaneCommand(sublime_plugin.WindowCommand):
    def run(self):
        # blablalbal
        window.set_layout(...)
pelemarse commented 3 years ago

Origami 2.2.3 Sublime Text 4 dev 4116

This issue no longer occurs after upgrading to Sublime Text dev 4 build 4116.

rchl commented 3 years ago

Can't reproduce either.