Add Ctrl+S and indicate when files are dirty
This commit is contained in:
@ -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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user