From 8cb1e63222b55e608abad81c0219a406166a2228 Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 5 Dec 2024 02:17:29 +0200 Subject: [PATCH] add comments --- .../tab/item/page/content/text/gemini/reader/syntax.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/browser/window/tab/item/page/content/text/gemini/reader/syntax.rs b/src/app/browser/window/tab/item/page/content/text/gemini/reader/syntax.rs index 16594b7e..7a3205ee 100644 --- a/src/app/browser/window/tab/item/page/content/text/gemini/reader/syntax.rs +++ b/src/app/browser/window/tab/item/page/content/text/gemini/reader/syntax.rs @@ -33,6 +33,9 @@ pub struct Syntax { } impl Syntax { + // Constructors + + /// Create new `Self` pub fn new() -> Self { Self { syntax_set: SyntaxSet::load_defaults_newlines(), @@ -40,6 +43,10 @@ impl Syntax { } } + // Actions + + /// Apply `Syntect` highlight to new buffer returned, + /// according to given `alt` and `source_code` content pub fn highlight( &self, source_code: &str,