Origami icon indicating copy to clipboard operation
Origami copied to clipboard

Autoclose doesnt work after moving last file

Open nicolashohm opened this issue 12 years ago • 14 comments

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.

nicolashohm avatar Jan 24 '14 15:01 nicolashohm

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.

adzenith avatar Jan 24 '14 21:01 adzenith

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

ghost avatar Feb 09 '18 17:02 ghost

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.

adzenith avatar Nov 21 '18 14:11 adzenith

Was carry_file_to_pane implemented? Must one enable this feature manualy?

krizajb avatar Jun 18 '19 11:06 krizajb

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

adzenith avatar Jun 20 '19 20:06 adzenith

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.

krizajb avatar Jun 20 '19 21:06 krizajb

Shall I open a new issue with the above description @adzenith?

krizajb avatar Jun 22 '19 19:06 krizajb

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.

adzenith avatar Jun 28 '19 03:06 adzenith

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 :)

krizajb avatar Jun 28 '19 11:06 krizajb

Ok, let me know! Thanks!

adzenith avatar Jun 28 '19 18:06 adzenith

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.

krizajb avatar Jul 06 '19 10:07 krizajb

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!

krizajb avatar Jul 06 '19 19:07 krizajb

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...?

adzenith avatar Jul 09 '19 01:07 adzenith

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 .

krizajb avatar Jul 09 '19 05:07 krizajb