From f29cc9ed25a52b28b7d5650b0fd3dc16457c3e65 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Thu, 27 Jan 2022 19:29:42 +0200 Subject: DocumentWidget: Navigate to parent vs. index.gmi index.gmi is typically identical to the directory itself, so don't go from `/index.gmi` to `/`, but skip directly to the parent directory. --- src/ui/documentwidget.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 550777af..beff0f3f 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -4301,6 +4301,9 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) else if (equal_Command(cmd, "navigate.parent") && document_App() == d) { iUrl parts; init_Url(&parts, d->mod.url); + if (endsWith_Rangecc(parts.path, "/index.gmi")) { + parts.path.end -= 9; /* This is the default index page. */ + } /* Remove the last path segment. */ if (size_Range(&parts.path) > 1) { if (parts.path.end[-1] == '/') { -- cgit v1.2.3