[Lazarus] Free Pascal Sources not found
adtec at adtec.co.za
adtec at adtec.co.za
Thu Nov 5 08:20:17 CET 2009
I just stumbled on the below
if SrcEdit.EditorComponent.SelectionMode<>smNormal then exit;
will not prevent the indent if an smColum mode block is inserted.
The mode of the data inserted has nothing to do with the mode of the
current block.
And after the insert, there is no block, therefore it can not be checked.
the new event will explicitly report the mode.
The advantage of OnPaste is that it will also be called for quick-paste
(middle mouse) which indenter currently is not.
Only thing that will not call anything, is drop-drag-edit (can be
addressed later)
Martin
> ecPaste:
> begin
> if not CodeToolsOpts.IndentOnPaste then exit;
> if SrcEdit.EditorComponent.SelectionMode<>smNormal then exit;
> if LogCaret.X>1 then
> inc(FirstLinePos);
> if LogCaret.Y=LastLinePos then
> dec(LastLinePos);
> if LastLinePos<FirstLinePos then exit; // not a whole line
> end
More information about the Lazarus
mailing list