fix(editing): recognize paragraph drafts as unsaved work (#811) (#843)

* view: check Shift-Command-G before Command-G for find navigation (#810)

* fix: recognize paragraph drafts as unsaved work (Issue #811)

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
This commit is contained in:
Krzysztof Cieślik
2026-10-10 15:11:19 -04:00
committed by GitHub
co-authored by Brandon Thomas
parent 724f13cced
commit f54aa1db1e
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -87,6 +87,11 @@ impl LineEditor {
(self.max_width > self.rect.width()).then_some(self.max_width)
}
/// Whether the edited text differs from the original (unsaved changes).
pub fn has_unsaved_text(&self) -> bool {
self.text != self.original
}
/// The formatting the panel changed.
pub fn style(&self) -> pdfcraft_engine::BlockStyle {
let (l, o) = (&self.look, &self.look0);
+1
View File
@@ -349,6 +349,7 @@ impl PdfCraftApp {
|| v.content.blocked().is_some()
|| v.forms.focus.as_ref().is_some_and(|f| crate::forms_ui::draft_edit(f, &doc.form).is_some())
|| v.fill_text.as_ref().is_some_and(|t| !t.text.trim().is_empty())
|| v.line_editor.as_ref().map_or_else(|| false, |ed| ed.has_unsaved_text())
}
/// Save the active document. Returns `true` if it was written.