From 8169adcb2fc311b01e49c31366270e39f71c0a0c Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Tue, 16 Mar 2021 13:21:28 -0400 Subject: [PATCH] Prep for multiline comments --- src/filetype.rs | 6 ++++++ src/highlighting.rs | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/filetype.rs b/src/filetype.rs index 127577d..e09d8a0 100644 --- a/src/filetype.rs +++ b/src/filetype.rs @@ -9,6 +9,7 @@ pub struct HighlightingOptions { strings: bool, characters: bool, comments: bool, + multiline_comments: bool, primary_keywords: Vec, secondary_keywords: Vec, } @@ -40,6 +41,7 @@ impl FileType { strings: true, characters: true, comments: true, + multiline_comments: true, primary_keywords: vec![ "as".to_string(), "break".to_string(), @@ -143,4 +145,8 @@ impl HighlightingOptions { pub fn secondary_keywords(&self) -> &Vec { &self.secondary_keywords } + + pub fn multiline_comments(&self) -> bool { + &self.multiline_comments + } } diff --git a/src/highlighting.rs b/src/highlighting.rs index 323ccfc..981c9a2 100644 --- a/src/highlighting.rs +++ b/src/highlighting.rs @@ -8,6 +8,7 @@ pub enum Type { String, Character, Comment, + MultilineComment, PrimaryKeywords, SecondaryKeywords, } @@ -19,7 +20,7 @@ impl Type { Type::Match => color::Rgb(38, 139, 210), Type::String => color::Rgb(211, 54, 130), Type::Character => color::Rgb(108, 113, 196), - Type::Comment => color::Rgb(133, 153, 0), + Type::Comment | Type::MultilineComment => color::Rgb(133, 153, 0), Type::PrimaryKeywords => color::Rgb(181, 137, 0), Type::SecondaryKeywords => color::Rgb(42, 161, 152), _ => color::Rgb(255, 255, 255),