[fractal] markdown: Enable highlighting during the initial load
- From: Christopher Davis <christopherdavis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal] markdown: Enable highlighting during the initial load
- Date: Tue, 16 Jul 2019 18:10:50 +0000 (UTC)
commit 2158b64a4b17aefe7834b78bbc033c129a0e9ae0
Author: Christopher Davis <brainblasted disroot org>
Date: Thu Jul 11 02:50:26 2019 -0700
markdown: Enable highlighting during the initial load
Previously we did not enable syntax highlighting if the user
already had markdown enabled during startup. This commit
ensures that we enable it.
Closes https://gitlab.gnome.org/GNOME/fractal/issues/302
fractal-gtk/src/app/connect/markdown.rs | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/fractal-gtk/src/app/connect/markdown.rs b/fractal-gtk/src/app/connect/markdown.rs
index 5314eb25..a6a49246 100644
--- a/fractal-gtk/src/app/connect/markdown.rs
+++ b/fractal-gtk/src/app/connect/markdown.rs
@@ -43,6 +43,12 @@ impl App {
markdown_switch.set_active(true);
md_img.set_from_icon_name("format-indent-more-symbolic", gtk::IconSize::Menu);
txt.get_style_context().remove_class("dim-label");
+
+ if let Some(md_lang) = md_lang.clone() {
+ buffer.set_highlight_matching_brackets(true);
+ buffer.set_language(&md_lang);
+ buffer.set_highlight_syntax(true);
+ }
}
let op = op.clone();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]