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

Autoclose doesnt work after moving last file #54

Open
nicolashohm opened this issue Jan 24, 2014 · 14 comments
Open

Autoclose doesnt work after moving last file #54

nicolashohm opened this issue Jan 24, 2014 · 14 comments

Comments

@nicolashohm
Copy link

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.

@adzenith
Copy link
Member

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.

@ghost
Copy link

ghost commented Feb 9, 2018

Here to vote for the close-empty-pane-on-carry feature, it would be super nice to have 😃

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

@adzenith
Copy link
Member

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.

@krizajb
Copy link

krizajb commented Jun 18, 2019

Was carry_file_to_pane implemented? Must one enable this feature manualy?

@adzenith
Copy link
Member

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

@krizajb
Copy link

krizajb commented Jun 20, 2019

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
Copy link

krizajb commented Jun 22, 2019

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

@adzenith
Copy link
Member

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.

@krizajb
Copy link

krizajb commented Jun 28, 2019

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

@adzenith
Copy link
Member

Ok, let me know! Thanks!

@krizajb
Copy link

krizajb commented Jul 6, 2019

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
Copy link

krizajb commented Jul 6, 2019

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!

@adzenith
Copy link
Member

adzenith commented Jul 9, 2019

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

@krizajb
Copy link

krizajb commented Jul 9, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants