GNOME Bugzilla – Bug 727016
Add support for "Close Other Tabs"
Last modified: 2020-11-24 09:58:30 UTC
We should be able to close other tabs except the active tab.
Why?
There will be a one more context menu "close other tabs". which will close the all other opened tabs. Feature suggested by Paolo.
close_confirmation_dialog_response_handler() check for the is_closing_all flag...initially getting assertion ** (gedit:16158): CRITICAL **: close_confirmation_dialog_response_handler: assertion 'unsaved_documents->next == NULL' failed because we are not setting the GEDIT_IS_CLOSING_ALL flag. if we set that flag and call the file_close_dialog who calls close_confirmation_dialog_response_handler() which closes all the tabs available in window. Thats why I think we need to add one more flag GEDIT_IS_CLOSING_OTHER_TABS , if it is set then we close only listed out tabs.
I second this request. Basically, it would be intuitive to support the same options which people are familiar with from working with visual studio and/or their browser: Close tab Close other tabs Close tabs to right (i use this quite a lot)
This would be really useful. A context menu item on the tab for "close all other tabs". Use case is common: You're working on a project, as you work a lot of tabs become opened, then it becomes time to refocus yourself on the file you are editing (also in gedit scrolling tabs becomes cumbersome once a lot of files are open). Current "workaround", which I use often, is to close gedit then reopen. Not the best but that's the only way to do it right now. I'm personally indifferent to "close tabs to the right". To me that makes sense in a browser (where you're following links in the current document and opening tons of tabs, each to the right) but isn't so applicable to a text editor. However, "Close all others" is a very common editor feature, and for good reason. Would be nice to see it in gedit too.
(PS Document -> Close All -> reopen the file you want is another "workaround" similar to restarting gedit and reopening.)
Created attachment 342048 [details] [review] Added item to tab right-click menu for "Close Other Tabs" I added the ability to right-click a tab and choose "Close Other Tabs". If a tab has been changed without being saved, it will prompt the user with the option to save each sequentially.
I'm not sure this feature is worth having, since there's a pretty easy way to do this today: right click the tab, select Move to New Window, then close the first window.
(In reply to Adam Dingle from comment #8) > I'm not sure this feature is worth having, since there's a pretty easy way > to do this today: right click the tab, select Move to New Window, then close > the first window. I'm not sure a "Save" item in the file menu is worth having, since there's a pretty easy way to do this already: select "Exit", answer "Save" when prompted to save changes before exiting, then restart gedit and reopen the file. I mean, realistically, "Close All Other Tabs" is a pretty fundamental feature... plus it doesn't exactly have any downsides. You've even got James' patch handed to you. It's possible that you don't use gedit for serious projects? I say give it a little upgrade. It's a great editor (it's *really* awesome for, say, node.js or python development, where even small projects end up with file counts in the dozens very quickly - the side panel makes it almost perfect). Make it better. I'll trade you the "Insert Date and Time" or "Close All" feature for it. :P
My opinion is not strong - I was just pointing out one possible alternative. If this feature existed I would probably use it from time to time. I'm not part of the core gedit team, just an interested observer (and yes, I have used gedit extensively for many years). I'll leave it to them to decide whether to accept the patch.
I found the lack of "Close Other Tabs" menu option annoying enough to figure out how to contribute to the gedit / gnome project, familiarize myself with the code base, and submit my first ever patch. The feature is so common in other editors that it bugged me a lot. Now that I'm familiar, expect more patches from me, it feels good to contribute.
Mass-closing of all gedit bugzilla tickets. Special "code" to find again all those gedit bugzilla tickets that were open before the mass-closing: 2bfe1b0590a78457e1f1a6a90fb975f5878cb60064ccfe1d7db76ca0da52f0f3 By searching the above sha256sum in bugzilla, the gedit contributors can find again the tickets. We may be interested to do so when we work on a specific area of the code, to at least know the known problems and possible enhancements. We do this mass-closing because bugzilla.gnome.org is being replaced by gitlab.gnome.org.