modified editor to include syntax for .dsc files
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user