diff options
Diffstat (limited to 'src/gmdocument.c')
-rw-r--r-- | src/gmdocument.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c index 4f9f97e7..cde714e7 100644 --- a/src/gmdocument.c +++ b/src/gmdocument.c | |||
@@ -285,6 +285,12 @@ static void clearLinks_GmDocument_(iGmDocument *d) { | |||
285 | clear_PtrArray(&d->links); | 285 | clear_PtrArray(&d->links); |
286 | } | 286 | } |
287 | 287 | ||
288 | static iBool isGopher_GmDocument_(const iGmDocument *d) { | ||
289 | const iRangecc scheme = urlScheme_String(&d->url); | ||
290 | return (equalCase_Rangecc(scheme, "gopher") || | ||
291 | equalCase_Rangecc(scheme, "finger")); | ||
292 | } | ||
293 | |||
288 | static iBool isForcedMonospace_GmDocument_(const iGmDocument *d) { | 294 | static iBool isForcedMonospace_GmDocument_(const iGmDocument *d) { |
289 | const iRangecc scheme = urlScheme_String(&d->url); | 295 | const iRangecc scheme = urlScheme_String(&d->url); |
290 | if (equalCase_Rangecc(scheme, "gemini")) { | 296 | if (equalCase_Rangecc(scheme, "gemini")) { |
@@ -360,6 +366,7 @@ static void updateOpenURLs_GmDocument_(iGmDocument *d) { | |||
360 | static void doLayout_GmDocument_(iGmDocument *d) { | 366 | static void doLayout_GmDocument_(iGmDocument *d) { |
361 | const iPrefs *prefs = prefs_App(); | 367 | const iPrefs *prefs = prefs_App(); |
362 | const iBool isMono = isForcedMonospace_GmDocument_(d); | 368 | const iBool isMono = isForcedMonospace_GmDocument_(d); |
369 | const iBool isGopher = isGopher_GmDocument_(d); | ||
363 | const iBool isNarrow = d->size.x < 90 * gap_Text; | 370 | const iBool isNarrow = d->size.x < 90 * gap_Text; |
364 | const iBool isVeryNarrow = d->size.x <= 70 * gap_Text; | 371 | const iBool isVeryNarrow = d->size.x <= 70 * gap_Text; |
365 | const iBool isExtremelyNarrow = d->size.x <= 60 * gap_Text; | 372 | const iBool isExtremelyNarrow = d->size.x <= 60 * gap_Text; |
@@ -475,7 +482,7 @@ static void doLayout_GmDocument_(iGmDocument *d) { | |||
475 | meta.flags = constValue_Array(oldPreMeta, preIndex, iGmPreMeta).flags & | 482 | meta.flags = constValue_Array(oldPreMeta, preIndex, iGmPreMeta).flags & |
476 | folded_GmPreMetaFlag; | 483 | folded_GmPreMetaFlag; |
477 | } | 484 | } |
478 | else if (prefs->collapsePreOnLoad) { | 485 | else if (prefs->collapsePreOnLoad && !isGopher) { |
479 | meta.flags |= folded_GmPreMetaFlag; | 486 | meta.flags |= folded_GmPreMetaFlag; |
480 | } | 487 | } |
481 | pushBack_Array(&d->preMeta, &meta); | 488 | pushBack_Array(&d->preMeta, &meta); |