Add Ctrl+S and indicate when files are dirty

This commit is contained in:
2025-06-15 12:39:52 +02:00
parent 1ed278cc55
commit 7d234641cb
4 changed files with 111 additions and 54 deletions

View File

@ -24,6 +24,10 @@ pub struct MdTextEdit {
cursor: Option<CCursorRange>,
}
pub struct MdTextEditOutput {
pub changed: bool,
}
impl MdTextEdit {
pub fn new() -> Self {
MdTextEdit::default()
@ -36,7 +40,7 @@ impl MdTextEdit {
}
}
pub fn ui(&mut self, ui: &mut Ui) {
pub fn ui(&mut self, ui: &mut Ui) -> MdTextEditOutput {
let Self {
text,
highlighter,
@ -72,6 +76,10 @@ impl MdTextEdit {
*cursor = text_edit.cursor_range;
//ui.ctx().request_repaint();
}
MdTextEditOutput {
changed: text_edit.response.changed(),
}
}
}