Skip to content

Commit

Permalink
[visualbndbuild] Reactivte dirty flag when editing the build script
Browse files Browse the repository at this point in the history
  • Loading branch information
rgiot committed Aug 13, 2023
1 parent 4bcc074 commit f5e3439
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cpclib-visual-bndbuild/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ impl BndBuildApp {
ui.close_menu();
}
}
ui.separator();

if ui
.add(Button::new("Quit").shortcut_text(ctx.format_shortcut(&CTRL_Q)))
Expand Down Expand Up @@ -417,18 +418,18 @@ impl BndBuildApp {
.max_height(f32::INFINITY)
.max_width(f32::INFINITY)
.show(ui, |ui| {
// let output = editor.show(ui);

let _output = CodeEditor::default()
let editor = CodeEditor::default()
.id_source("code editor")
.with_fontsize(14.0)
.with_theme(ColorTheme::GITHUB_LIGHT)
.with_syntax(syntax())
.with_numlines(true)
.show(ui, code);
// if output.response.changed() {
// self.is_dirty = true;
// }

if editor.changed() {
self.is_dirty = true;
}
});
}
});
Expand Down Expand Up @@ -609,6 +610,7 @@ impl eframe::App for BndBuildApp {
self.file_error = e.to_string().into();
}
else {
self.file_error = None;
self.is_dirty = false;
self.load(self.filename.clone().unwrap()); // reload is forced to parse the file
}
Expand Down

0 comments on commit f5e3439

Please sign in to comment.