modified editor to include syntax for .dsc files

This commit is contained in:
2026-02-05 01:26:37 +00:00
parent b8abbfd02f
commit e69514e46e
4 changed files with 30 additions and 60 deletions
+4 -7
View File
@@ -393,8 +393,9 @@ impl Editor {
fn render_editor(&mut self, _state: &mut State, ui: &mut Ui, _ctx: &Context) {
let available_width = ui.available_width();
let syntax = match self.extension() {
"dsa" => Some(Syntax::new("dsa")),
_ => None,
"dsa" => Syntax::dsa(),
"dsc" => Syntax::dsc(),
_ => Syntax::default(),
};
let ed = CodeEditor::default()
@@ -402,16 +403,12 @@ impl Editor {
.with_fontsize(12.0)
.with_rows(0)
.with_theme(ColorTheme::default())
.with_syntax(Syntax::dsa())
.with_syntax(syntax)
.with_numlines(true)
.desired_width(available_width - 500.0);
let mut editor = ed.clone();
if let Some(syntax) = syntax {
editor = ed.with_syntax(syntax);
}
editor.show(ui, &mut self.text);
}