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

Feature: Prevent INLINE tabs sticking #1947

Open
IPWright83 opened this issue Sep 2, 2024 · 5 comments
Open

Feature: Prevent INLINE tabs sticking #1947

IPWright83 opened this issue Sep 2, 2024 · 5 comments

Comments

@IPWright83
Copy link

I'm terrible at closing tabs/windows/terminals (pretty much anything!). In GitSavvy I tend to use the inline diff to view and stage changes... but then I have a habit of forgetting to close them. Then they often appear in search results or file navigation and generally get in the way because you can't edit/interact with the code there properly.

I was wondering about adding a "sticky: false" option, then finding a way to make Sublime auto-close when you navigate away from them so they essentially tidy themselves up as they're a little ephemeral compared to other tabs. But I thought before trying to put together a PR?

@kaste
Copy link
Collaborator

kaste commented Sep 2, 2024

I have dangling views from GitSavvy all over the place. Actually seldomly the INLINE DIFF tabs but the SHOW-COMMIT and FILE tabs and specialized pick-axe, line history graphs. But I don't have a proper solution idea. For the standard DIFF views I have actually code that closes them after committing.

I don't expect the simple "on navigate away" would be satisfactory, but I think you should just try this not as a PR but a simple user plugin/addon. "on navigate away" is in fact Sublime's "on_deactivated" event where you could probably just check for inline views and close them. Try it, tune it and report back. 😀

@IPWright83
Copy link
Author

No worries @kaste, I did think about a custom plugin too but thought I'd ask here first in-case it's useful for others. I'll let you know if/when I've something working.

@IPWright83
Copy link
Author

Still waiting to get into the official Sublime package repository but I created this: https://github.com/IPWright83/sublime-AutoTabClose

@kaste
Copy link
Collaborator

kaste commented Sep 21, 2024

Not sure, but doesn't on_deactivated trigger just by opening the Command Palette. Basically when on the INLINE diff, it would close just by ctrrl+shit+p. Other than that it looks useful for the INLINE views.

I don't see it fit the e.g. "FILE" case as it is natural to have a "live" version of a file and its historical variant ("FILE: ") side by side for comparison, and to switch between them.

@IPWright83
Copy link
Author

on_deactivated seemed to work fine, upon losing focus the tab will get closed.

It doesn't work for all views, as some pop up some UI's which then cause the tab to close.

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

2 participants