diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2022-01-24 13:57:30 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2022-01-24 13:57:30 +0200 |
commit | 8f6d0c7b1bc14b0b850679bacfbe5ecc2f629e20 (patch) | |
tree | 2bbddc99f4493b0f209667d2ab7f20292aa5452e /src/ui/documentwidget.c | |
parent | ba16812ec46022dc8a868445f75c943659dbf637 (diff) |
Gopher: Set item type to 1 when navigating to parent
As suggested in: gemini://ruario.flounder.online/gemlog/2022-01-19_Some_Gopher_improvements_for_Lagrange.gmi
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r-- | src/ui/documentwidget.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 93604225..4332ae8f 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -4309,9 +4309,17 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) | |||
4309 | if (parts.path.end[-1] == '/') break; | 4309 | if (parts.path.end[-1] == '/') break; |
4310 | parts.path.end--; | 4310 | parts.path.end--; |
4311 | } | 4311 | } |
4312 | postCommandf_Root(w->root, | 4312 | iString *parentUrl = collectNewRange_String((iRangecc){ constBegin_String(d->mod.url), |
4313 | "open url:%s", | 4313 | parts.path.end }); |
4314 | cstr_Rangecc((iRangecc){ constBegin_String(d->mod.url), parts.path.end })); | 4314 | if (equalCase_Rangecc(parts.scheme, "gopher")) { |
4315 | /* Always go to a gophermap. */ | ||
4316 | iZap(parts); | ||
4317 | init_Url(&parts, parentUrl); | ||
4318 | if (parts.path.start && size_Range(&parts.path) >= 2) { | ||
4319 | ((char *) parts.path.start)[1] = '1'; | ||
4320 | } | ||
4321 | } | ||
4322 | postCommandf_Root(w->root, "open url:%s", cstr_String(parentUrl)); | ||
4315 | } | 4323 | } |
4316 | return iTrue; | 4324 | return iTrue; |
4317 | } | 4325 | } |