Skip to content

Commit

Permalink
Fixed: (IMPORTANT). "Show word count in status bar" in notes with 300…
Browse files Browse the repository at this point in the history
…00+ 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.
  • Loading branch information
dpradov committed May 9, 2024
1 parent 0dfb8a6 commit d1143b9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ui/knt.ui.editor.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d1143b9

Please sign in to comment.