From d1143b9d6dc2f4f4ba1a34b1e4421c560e0c3c26 Mon Sep 17 00:00:00 2001 From: Daniel Prado Velasco Date: Thu, 9 May 2024 22:25:29 +0200 Subject: [PATCH] Fixed: (IMPORTANT). "Show word count in status bar" in notes with 30000+ chars can corrupt that note Typing in a note with more than 30000 characters, instead of showing (...) W:...... in the status bar, would corrupt the content of the note, as indicated in #695. It was caused by a seemingly innocent error (an oversight) in the first commit of the refactoring, in version 1.9.3, but with important consequences. In the affected code, "Text" was a property of a control of status bar. After refactoring it was the content of the editor... It should have been written as "txt", not Text. --- ui/knt.ui.editor.pas | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ui/knt.ui.editor.pas b/ui/knt.ui.editor.pas index b2b0f8ac..8f3a474f 100644 --- a/ui/knt.ui.editor.pas +++ b/ui/knt.ui.editor.pas @@ -2322,15 +2322,11 @@ procedure TKntRichEdit.CheckWordCountWaiting; begin if EditorOptions.WordCountTrack and (TextLength > 30000) then begin txt:= App.WordCountInfoInStatusBar; - if pos(waiting, txt) <> 1 then - Text:= Waiting + Text; - App.WordCountInfoInStatusBar:= Waiting + txt; + if (pos('...', txt) = 0) then + App.WordCountInfoInStatusBar:= Waiting + txt; end; end; - - - procedure TKntRichEdit.UpdateCursorPos; var p : TPoint;