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) {
|
match syntax.highlight(&c.value, alt) {
|
||||||
Ok(highlight) => {
|
Ok(highlight) => {
|
||||||
for (syntax_tag, entity) in highlight {
|
for (syntax_tag, entity) in highlight {
|
||||||
// Register new tag
|
assert!(tag.text_tag_table.add(&syntax_tag));
|
||||||
if !tag.text_tag_table.add(&syntax_tag) {
|
|
||||||
todo!()
|
|
||||||
}
|
|
||||||
// Append tag to buffer
|
|
||||||
buffer.insert_with_tags(
|
buffer.insert_with_tags(
|
||||||
&mut buffer.end_iter(),
|
&mut buffer.end_iter(),
|
||||||
&entity,
|
&entity,
|
||||||
|
|
@ -166,11 +162,7 @@ impl Gemini {
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
// Try ANSI/SGR format (terminal emulation) @TODO optional
|
// Try ANSI/SGR format (terminal emulation) @TODO optional
|
||||||
for (syntax_tag, entity) in ansi::format(&c.value) {
|
for (syntax_tag, entity) in ansi::format(&c.value) {
|
||||||
// Register new tag
|
assert!(tag.text_tag_table.add(&syntax_tag));
|
||||||
if !tag.text_tag_table.add(&syntax_tag) {
|
|
||||||
todo!()
|
|
||||||
}
|
|
||||||
// Append tag to buffer
|
|
||||||
buffer.insert_with_tags(
|
buffer.insert_with_tags(
|
||||||
&mut buffer.end_iter(),
|
&mut buffer.end_iter(),
|
||||||
&entity,
|
&entity,
|
||||||
|
|
@ -187,7 +179,7 @@ impl Gemini {
|
||||||
// Skip other actions for this line
|
// Skip other actions for this line
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Err(_) => todo!(),
|
Err(_) => panic!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue