[Github-comments] [geany/geany-plugins] Project Organizer: Add option to open current folder in file manager and terminal (PR #1126)

xiota notifications at xxxxx
Wed Nov 10 23:16:25 UTC 2021


@xiota commented on this pull request.



> +		}
+	}
+	return path;
+}
+
+
+/* if get_dir_of_selection() fails,
+ * returns parent of current document, project folder, or home folder */
+static gchar *get_fallback_dir_of_selection(void)
+{
+	gchar *locale_path;
+
+	/* get path from treeview selection */
+	locale_path = get_dir_of_selection();
+
+	/* get path from current document */

> they aren't what the user wanted anyway

There is a keybinding to open the terminal, so the treeview doesn't necessarily have a selection when the terminal is opened.  While I have been using this, most of the time, it's the path to the document that I want.  The exception is if something is selected in the treeview.  New documents don't have an assigned path, so the fallback is the project path.  If the project path is invalid (which could happen when the project folder is moved without updating preferences) the user home folder is used.

-- 
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-plugins/pull/1126#discussion_r747059281
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211110/1bef3f45/attachment.htm>


More information about the Github-comments mailing list