I registered an account in the bug report forum, And added a note about SelLength in the bug report. thank you, Handoko, you're a kind man!
I can't implement the Undo and Redo functions through the OnChange event, because the OnChange event has different performance under Windows and Linux, and I couldn't get the Text and SelStart I needed in the Onchange event, and my ability is limited. I hope the official can implement TMemo's Undo and Redo functions, because it is the most basic function, without this function, the content of TMemo is like losing protection, it is very uneasy to use.
Thank you for the efforts made by community members for Lazarus, and hope Lazarus is getting better and better.