Lazarus
Programming => Packages and Libraries => SynEdit => Topic started by: Edson on October 11, 2013, 08:42:20 pm
-
Are these methods:
BeginUndoBlock and EndUndoBlock
enabled in SynEdit?
If so, How do they work?
-
yes they are.
BeginUndoBlock;
//call edit
//call edit
//...
EndUndoBlock;
All edits will be undone in a single undo.
Without the undoblock, each edit requires one undo
Please read:
http://wiki.lazarus.freepascal.org/SynEdit#Change_text_from_code
access to SynEdit.Lines never works with undo
-
Thanks Martin,
I haven't found information about these methods of SynEdit.
The wiki is a little poor about SynEdit.
In fact, I have started to complete the spanish version: http://wiki.freepascal.org/SynEdit/es
-
well yes, documenting synedit is still a big todo.
but the methods should be self explaining. Use code navigation, and you will see the declaration.
SynEdit.TextBetweenPoints[ Point(x,y), Point(x2,y2) ] := 'abc';
works like setting block-selection begin/end and then SelText := 'abc'
x,y are "logical". see same wiki page