mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 08:35:28 +00:00
minor syntax optimizations
This commit is contained in:
parent
e92eb318b3
commit
38f9cca422
1 changed files with 3 additions and 11 deletions
|
|
@ -151,11 +151,7 @@ impl Gemini {
|
|||
match syntax.highlight(&c.value, alt) {
|
||||
Ok(highlight) => {
|
||||
for (syntax_tag, entity) in highlight {
|
||||
// Register new tag
|
||||
if !tag.text_tag_table.add(&syntax_tag) {
|
||||
todo!()
|
||||
}
|
||||
// Append tag to buffer
|
||||
assert!(tag.text_tag_table.add(&syntax_tag));
|
||||
buffer.insert_with_tags(
|
||||
&mut buffer.end_iter(),
|
||||
&entity,
|
||||
|
|
@ -166,11 +162,7 @@ impl Gemini {
|
|||
Err(_) => {
|
||||
// Try ANSI/SGR format (terminal emulation) @TODO optional
|
||||
for (syntax_tag, entity) in ansi::format(&c.value) {
|
||||
// Register new tag
|
||||
if !tag.text_tag_table.add(&syntax_tag) {
|
||||
todo!()
|
||||
}
|
||||
// Append tag to buffer
|
||||
assert!(tag.text_tag_table.add(&syntax_tag));
|
||||
buffer.insert_with_tags(
|
||||
&mut buffer.end_iter(),
|
||||
&entity,
|
||||
|
|
@ -187,7 +179,7 @@ impl Gemini {
|
|||
// Skip other actions for this line
|
||||
continue;
|
||||
}
|
||||
Err(_) => todo!(),
|
||||
Err(_) => panic!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue