@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.