[Github-comments] [geany/geany] Add "Close Documents to the Right" feature (#1362)

Colomban Wendling notifications at xxxxx
Sat Aug 19 23:33:36 UTC 2017


b4n commented on this pull request.



> +	gint doc_page = document_get_notebook_page(doc);
+	return total_pages > (doc_page + 1);
+}
+
+
+void on_close_documents_right_activate(GtkMenuItem *menuitem, GeanyDocument *doc)
+{
+	g_return_if_fail(has_tabs_on_right(doc));
+	GtkNotebook *nb = GTK_NOTEBOOK(main_widgets.notebook);
+	gint doc_page = document_get_notebook_page(doc);
+	for (gint i = doc_page + 1; i < gtk_notebook_get_n_pages(nb); )
+	{
+		if (! document_close(document_get_from_page(i)))
+			i++; // only increment if tab wasn't closed
+	}
+	gtk_notebook_set_current_page(nb, doc_page);

This should probably not go to the document's page but to the originally current one if it hasn't been closed; because like that using the feature on a non-current tab makes that tab current, even if the previously active tab was on the left of the one on which you activated the feature.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1362#pullrequestreview-57360440
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20170819/c1d34e60/attachment.html>


More information about the Github-comments mailing list