Make M-Up go to the parent directory

As in Windows Explorer and other software.
This commit is contained in:
Přemysl Eric Janouch 2021-12-20 09:58:17 +01:00
parent 1221325b3e
commit 58d11ebbff
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -594,6 +594,14 @@ on_key_press(G_GNUC_UNUSED GtkWidget *widget, GdkEventKey *event,
else else
switch_to_view(g.path); switch_to_view(g.path);
return TRUE; return TRUE;
case GDK_KEY_Up:
if (gtk_stack_get_visible_child(GTK_STACK(g.stack)) != g.view_box) {
// This isn't exact, trailing slashes should be ignored.
gchar *parent = g_path_get_dirname(g.directory);
load_directory(parent);
g_free(parent);
}
return TRUE;
} }
break; break;
case 0: case 0: