[Github-comments] [geany/geany] Notebook menu: Add submenu to close all documents in/not in current folder (#2346)

elextr notifications at xxxxx
Tue Oct 8 21:22:21 UTC 2019


elextr commented on this pull request.



> +	if (cur_doc == NULL)
+		cur_doc = document_get_current();
+	if (!cur_doc->real_path)
+		return;
+
+	gchar *dir = g_dirname(cur_doc->real_path);
+
+	for (gint i = 0; i < gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)); i++)
+	{
+		GeanyDocument *doc = document_get_from_page(i);
+
+		if (!doc->real_path)
+			continue;
+		if (other_folders && g_str_has_prefix(doc->real_path, dir))
+			continue;
+		if (!other_folders && !g_str_has_prefix(doc->real_path, dir))

If you mean closing in the whole tree subtree, that probably would be better on the documents sidebar where the specific root directory can be selected, you may not have files in that specific directory open, only subdirectories.

-- 
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/2346#discussion_r332739742
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20191008/eee51a63/attachment-0001.html>


More information about the Github-comments mailing list