Autoclose doesnt work after moving last file
i enabled the option "origami_auto_close_empty_panes" in my settings, so if i close the last file in a pane, it close, but if i move the last file to an other pane by drag&drop the pane doesn't close. And using the command carry_file_to_pane also doesn't trigger the auto close.
Unfortunately there's no mechanism in Sublime Text for a plugin to be notified when you drag & drop. I can make it happen for carry file to pane, though.
Here to vote for the close-empty-pane-on-carry feature, it would be super nice to have :smiley:
That said, does anyone know of a setting deep in sublime to auto-close any empty panes? I feel like there should be an option for it by now but google and the default preferences page aren't giving me much to go on
I think this could also be done for drag-n-drop, by watching on_activated. We get a view activation at the end of a drag-n-drop sequence. The trick then becomes figuring out whether a new view got opened or if you moved something around.
Was carry_file_to_pane implemented? Must one enable this feature manualy?
This feature is implemented for carry_file_to_pane. You need to turn on origami_auto_close_empty_panes in your Sublime prefs. Something like:
"origami_auto_close_empty_panes": true
Unfortunatelly that doesn't work for me. I have that setting enabled and when I carry_file_to_pane the pane without any files doesn't automatically close.
Maybe I am missing something, here are the commands I am using to reproduce my issue:
Open the right pane and carry the current file to the pane:
"command": "carry_file_to_pane", "args": {"direction": "right"}
Move the file on the right pane back to the left pane:
"command": "carry_file_to_pane", "args": {"direction": "left"}
File moves to the left pane, right pane stays opened contanining no files.
Tried storing "origami_auto_close_empty_panes": true in the Preferences.sublime-settings and in theOrigami.sublime-settings file.
Shall I open a new issue with the above description @adzenith?
It works fine for me - are you sure you have that setting correct? If I carry a file with that setting enabled, the pane closes as expected.
I am 100% sure, maybe it is in conflict with some other plugin? I will do a fresh install of sublime3 with just Origami and see if it works, then slowly re-add all custom settings and plugins. Will keep you updated :)
Ok, let me know! Thanks!
I stripped my sublime3 and installed only origami, enabled the auto_close functionality and experianced the same behaviour. I started debugging your package and the AutoCloseEmptyPanes does not interact with carry_file_to_pane.
This is stack trace when moving last file from the right to the left pane "command": "carry_file_to_pane", "args": {"direction": "left"}:
-
carry_file_to_pane -
travel_to_pane
This is stack trace when closing last file on the pane (mouse click):
-
on_pre_close -
on_close -
destroy_pane -
destroy_current_pane -
travel_to_pane -
destroy_pane -
on_pre_close -
on_close
First case doesn't close the empty pane, second does.
I have decided to fork the package and modify it to satisfy my needs. See here if interested how I wanted the pane management to work: "patch". Non the less, great work!
I still can't reproduce - I'm able to carry any file to any pane and have the empty pane close correctly. What version of Sublime Text do you have...?
Latest 3, using windows or linux produces the same results.
On Tue, Jul 9, 2019, 03:35 Nikolaus Wittenstein [email protected] wrote:
I still can't reproduce - I'm able to carry any file to any pane and have the empty pane close correctly. What version of Sublime Text do you have...?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SublimeText/Origami/issues/54?email_source=notifications&email_token=AADZDXRWR5QNQJQGMGV4Q4DP6PTONA5CNFSM4ALRJNU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZOZ6XY#issuecomment-509452127, or mute the thread https://github.com/notifications/unsubscribe-auth/AADZDXTK5QUMAGJTTJ6HUCTP6PTONANCNFSM4ALRJNUQ .