mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 17:45:28 +00:00
add comments
This commit is contained in:
parent
3e2205015a
commit
8cb1e63222
1 changed files with 7 additions and 0 deletions
|
|
@ -33,6 +33,9 @@ pub struct Syntax {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Syntax {
|
impl Syntax {
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
/// Create new `Self`
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
syntax_set: SyntaxSet::load_defaults_newlines(),
|
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(
|
pub fn highlight(
|
||||||
&self,
|
&self,
|
||||||
source_code: &str,
|
source_code: &str,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue