Reputation: 401
There is a procedure SynEdit.InsertTextAtCaret('Text') for Lazarus version of SynEdit. How to insert text at caret for Delphi version of SynEdit with undo support?
Upvotes: 1
Views: 1867
Reputation: 136
There is procedure
TCustomSynEdit.procedure InsertBlock(const BB, BE: TBufferCoord; ChangeStr: PWideChar; AddToUndoList: Boolean);
It inserts ChangeStr changing text from BB to BE position. You may set BB and BE to current caret coordinates and you'll get what you want
For example
SynEdit1.InsertBlock(SynEdit1.CaretXY, SynEdit1.CaretXY, 'test', true);
Upvotes: 3