mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
replace find_syntax_by_extension with find_syntax_by_token
This commit is contained in:
parent
3bbeab5713
commit
15a63a21c9
@ -32,12 +32,12 @@ impl Syntax {
|
|||||||
source_tag: &TextTag,
|
source_tag: &TextTag,
|
||||||
alt: Option<&String>,
|
alt: Option<&String>,
|
||||||
) -> Result<Vec<(TextTag, String)>, Error> {
|
) -> Result<Vec<(TextTag, String)>, Error> {
|
||||||
if let Some(name) = alt {
|
if let Some(value) = alt {
|
||||||
if let Some(reference) = self.syntax_set.find_syntax_by_name(name) {
|
if let Some(reference) = self.syntax_set.find_syntax_by_name(value) {
|
||||||
return self.syntect_buffer(source_code, source_tag, reference);
|
return self.syntect_buffer(source_code, source_tag, reference);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(reference) = self.syntax_set.find_syntax_by_extension(name) {
|
if let Some(reference) = self.syntax_set.find_syntax_by_token(value) {
|
||||||
return self.syntect_buffer(source_code, source_tag, reference);
|
return self.syntect_buffer(source_code, source_tag, reference);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user