After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 727016 - Add support for "Close Other Tabs"
Add support for "Close Other Tabs"
Status: RESOLVED OBSOLETE
Product: gedit
Classification: Applications
Component: general
3.12.x
Other Linux
: Normal enhancement
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2014-03-25 11:43 UTC by Sagar Ghuge
Modified: 2020-11-24 09:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Added item to tab right-click menu for "Close Other Tabs" (4.43 KB, patch)
2016-12-16 02:47 UTC, James Seibel
none Details | Review

Description Sagar Ghuge 2014-03-25 11:43:22 UTC
We should be able to close other tabs except the active tab.
Comment 1 André Klapper 2014-03-25 12:38:08 UTC
Why?
Comment 2 Sagar Ghuge 2014-03-25 13:08:07 UTC
There will be a one more context menu "close other tabs". which will close the all other opened tabs. Feature suggested by Paolo.
Comment 3 Sagar Ghuge 2014-03-28 13:23:30 UTC
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.
Comment 4 James Ford 2015-07-31 22:16:37 UTC
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)
Comment 5 Jason C 2016-12-15 19:55:07 UTC
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.
Comment 6 Jason C 2016-12-15 19:56:40 UTC
(PS Document -> Close All -> reopen the file you want is another "workaround" similar to restarting gedit and reopening.)
Comment 7 James Seibel 2016-12-16 02:47:39 UTC
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.
Comment 8 Adam Dingle 2016-12-16 12:32:09 UTC
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.
Comment 9 Jason C 2016-12-16 14:02:33 UTC
(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
Comment 10 Adam Dingle 2016-12-16 14:09:10 UTC
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.
Comment 11 James Seibel 2016-12-16 16:41:27 UTC
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.
Comment 12 Sébastien Wilmet 2020-11-24 09:58:30 UTC
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.