[Lazarus] syncro mode[Re: Auto indentation]
Mattias Gaertner
nc-gaertnma at netcologne.de
Wed Nov 4 20:54:33 CET 2009
On Wed, 04 Nov 2009 00:27:20 +0000
Martin <lazarus at mfriebe.de> wrote:
> Further thought about auto indent (for paste) and syncro/template
> mode.
I disabled auto indent during syncro/template editing.
> The only reliable position is the final caret pos (based on that you
> can do indent on return)
I use that now for ecLineBreak.
> - the line-range will be too big.
> - the inital caret position will be unusable. because the if any cell
> was above the caret pos, then the text will have moved downwards,
> while the initial caretpos would still be on top
>
>
> syncro and template edit are created in Sourceeditor around line
> 2565. They are owned and destroyed by synedit (however synedit only
> knows they are plugins, and has no idea what they do)
>
> SourceEditor could keep a reference to the syncro and template module.
>
> Both of them have an Active property. If it is true, you should not
> indent-on-paste
>
> -------
> The alternative is to have an "OnBeforePaste" event, and modify the
> text to be pasted, *before* synedit inserts it
> (or keep the to-be-pasted text, and act backwards on the final caret
> pos)
I guess this is the better solution for ecPaste.
Can you add such an event?
Mattias
More information about the Lazarus
mailing list