@@ -2866,7 +2866,9 @@ void MainWindow::notesWereModified(const QString &str) {
28662866 const bool isCurrentNoteNotEditedForAWhile =
28672867 this ->currentNoteLastEdited .addSecs (60 ) < QDateTime::currentDateTime ();
28682868 // If the current note wasn't edited for a while, we want that it is possible
2869- // to get updated even with small changes, so we are setting a threshold of 0
2869+ // to get updated even with small changes, so we are setting a threshold of 0.
2870+ // If it was recently edited, we use a threshold of 8 for the similarity check
2871+ // to avoid false positives, but we'll still show the dialog if changes are detected.
28702872 const int threshold = isCurrentNoteNotEditedForAWhile ? 0 : 8 ;
28712873
28722874 // Check if the old note text is the same or similar as the one on disk
@@ -2891,8 +2893,10 @@ void MainWindow::notesWereModified(const QString &str) {
28912893 const QString noteTextEditText = this ->ui ->noteTextEdit ->toPlainText ();
28922894
28932895 // skip dialog if text of note file on disk text from note text
2894- // edit are equal or similar
2895- if (Utils::Misc::isSimilar (noteTextEditText, noteTextOnDisk, threshold)) {
2896+ // edit are equal or similar, but only if the note wasn't edited recently
2897+ // If it was recently edited, we want to show the dialog even for small changes
2898+ if (isCurrentNoteNotEditedForAWhile &&
2899+ Utils::Misc::isSimilar (noteTextEditText, noteTextOnDisk, threshold)) {
28962900 qDebug () << __func__ << " - Note text and text on disk are too similar, ignoring" ;
28972901 return ;
28982902 }
0 commit comments