From 97c497000afb7dd27bf7139e6ca49edf96fedbe4 Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 23 Mar 2026 03:13:00 +0200 Subject: [PATCH] use single line --- .../tab/item/page/content/text/gemini.rs | 21 +++++-------------- .../item/page/content/text/gemini/ansi/tag.rs | 2 +- .../page/content/text/gemini/syntax/tag.rs | 2 +- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/app/browser/window/tab/item/page/content/text/gemini.rs b/src/app/browser/window/tab/item/page/content/text/gemini.rs index ceceeb17..56f554e8 100644 --- a/src/app/browser/window/tab/item/page/content/text/gemini.rs +++ b/src/app/browser/window/tab/item/page/content/text/gemini.rs @@ -131,27 +131,21 @@ impl Gemini { // Is alt provided let alt = match c.alt { Some(ref alt) => { - // Insert alt value to the main buffer buffer.insert_with_tags( &mut buffer.end_iter(), alt.as_str(), &[&tag.title], ); - - // Append new line after alt text buffer.insert(&mut buffer.end_iter(), NEW_LINE); - - // Return value as wanted also for syntax highlight detection + text_view.add_child_at_anchor( + &separator::horizontal(&text_view), + &buffer.create_child_anchor(&mut buffer.end_iter()), + ); + buffer.insert(&mut buffer.end_iter(), NEW_LINE); Some(alt) } None => None, }; - - text_view.add_child_at_anchor( - &separator::horizontal(&text_view), - &buffer.create_child_anchor(&mut buffer.end_iter()), - ); - // Begin code block construction // Try auto-detect code syntax for given `value` and `alt` @TODO optional match syntax.highlight(&c.value, alt) { @@ -178,11 +172,6 @@ impl Gemini { } // @TODO handle } - text_view.add_child_at_anchor( - &separator::horizontal(&text_view), - &buffer.create_child_anchor(&mut buffer.end_iter()), - ); - // Reset code = None; } diff --git a/src/app/browser/window/tab/item/page/content/text/gemini/ansi/tag.rs b/src/app/browser/window/tab/item/page/content/text/gemini/ansi/tag.rs index 73583704..7154b1f3 100644 --- a/src/app/browser/window/tab/item/page/content/text/gemini/ansi/tag.rs +++ b/src/app/browser/window/tab/item/page/content/text/gemini/ansi/tag.rs @@ -20,7 +20,7 @@ impl Tag { Self { text_tag: TextTag::builder() .family("monospace") // @TODO - //.left_margin(28) + .left_margin(28) .scale(0.81) // * the rounded `0.8` value crops text for some reason @TODO .wrap_mode(WrapMode::None) .build(), diff --git a/src/app/browser/window/tab/item/page/content/text/gemini/syntax/tag.rs b/src/app/browser/window/tab/item/page/content/text/gemini/syntax/tag.rs index bf7c8959..4b2011b8 100644 --- a/src/app/browser/window/tab/item/page/content/text/gemini/syntax/tag.rs +++ b/src/app/browser/window/tab/item/page/content/text/gemini/syntax/tag.rs @@ -20,7 +20,7 @@ impl Tag { Self { text_tag: TextTag::builder() .family("monospace") // @TODO - //.left_margin(28) + .left_margin(28) .scale(0.81) // * the rounded `0.8` value crops text for some reason @TODO .wrap_mode(WrapMode::None) .build(),