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

Add "Close Documents To The Right" to document context menu #566

Closed
wants to merge 2 commits into from

Conversation

ndunsworth
Copy link

Add a "Close Documents To The Right" option to the right click context menu of documents.

This functionality mimics a feature found in the Chrome web-browser for quickly closing all open tabs after the selected one.

{
GeanyDocument *doc = documents[i];

if (! doc->is_valid)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use DOC_VALID()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't necessarily like it, but I think the "sanctioned" way is like:

guint i;
foreach_document(i)
{
    if (! document_close(document[i]))
        break;
}

Nevermind, didn't notice the starting at document non-zero (though I'm not sure order of the documents array strictly matches visible order).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a very valid remark. No, the documents_array is not in "tab order".

See document_account_for_unsaved() (but I think it would be better to create a copy and sort it with g_ptr_array_sort() and document_compare_by_tab_order(), it's kind of ugly to loop through the notebook pages directly IMO)

@kugel-
Copy link
Member

kugel- commented Jul 13, 2015

Btw, firefox has this too.

@codebrainz
Copy link
Member

Should it have "Close Documents to the Left" too? And what happens if the GUI is layed-out for right-to-left?

@kugel-
Copy link
Member

kugel- commented Jul 14, 2015

I think to the left is not as useful because new tabs are always added to the right of the current doc or to the end (most right). I think this is more used in a "close recently opened" sense. Firefox has only close to the right.

@codebrainz
Copy link
Member

Firefox has only close to the right

That's what made me think of it, because I'm always annoyed in Firefox that I can't do it. It might be different for browser tabs, but I often find as I add more tabs on the right I get to a point where I just want to close all but the newest tabs (those to the left of one of the right-most tabs). I don't know for sure if it transfers to editor tabs though.

@techee
Copy link
Member

techee commented Jul 14, 2015

Regarding the right/left naming there's also a problem when the tabs are on the right side, which is how I use Geany, and where it becomes top/bottom.

@elextr
Copy link
Member

elextr commented Jul 14, 2015

Yeah, I use tabs on the left side, suggested above that the message become
"Close Tabs Below".

On 14 July 2015 at 19:04, Jiří Techet notifications@github.com wrote:

Regarding the right/left naming there's also a problem when the tabs are
on the right side, which is how I use Geany, and where it becomes
top/bottom.


Reply to this email directly or view it on GitHub
#566 (comment).

@kugel-
Copy link
Member

kugel- commented Jul 31, 2015

@ndunsworth Are you still working on this and want it to be merged? If not we might close this.

@codebrainz
Copy link
Member

Closing because of #1362 and a408230.

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

Successfully merging this pull request may close these issues.

None yet

5 participants