kryslt / KControls

Free components for Delphi and Lazarus, this is the main repository maintained by the original author.
BSD 3-Clause Clear License
59 stars 32 forks source link

Plain text pasting at very end of a kMemo #16

Closed davidbannon closed 4 years ago

davidbannon commented 4 years ago

Very similar to #14, this bug happens when you paste multiline plain text at the very end of a KMemo. Nothing, even a para block beyond the cursor. Kmemo gets confused if asked to insert beyond where it thinks its end is, it does not realise that end has been extended.

I feel silly zipping up a one work patch - kmemo.pas,

12930        if InsertParagraph(AIndex, True) then
12931          Inc(AIndex);
                  UpdateAttributes;                   // drb Jan 2020, new line !!!
12932        St := I + 1;

PasteAtEnd.txt PasteAtEnd.zip

Patch attached. Tested on Lazarus, Windows and Unix.