[Lazarus] Auto indentation

Mattias Gärtner nc-gaertnma at netcologne.de
Tue Nov 3 17:22:48 CET 2009


Zitat von Paul Ishenin <webpirat at mail.ru>:

> Mattias Gärtner wrote:
>>> the code in the buffer is:
>>> [code]
>>> for i := 0 to 10 do
>>> if i = j then begin
>>> j := i;
>>> end;
>>> [/code]
>>
>> Just a note:
>> The indenter indents the pasted block as whole, not every line.
>> This has pros and cons. Maybe eventually an option can be added to  
>> indent instead every line. Indenting every line means bad and good  
>> indenting will be undone. IMO this is the inferior technique.
>> With the current synedit line ranges only the line-indenting can be  
>> implemented.
> Ok, but in any way the final 'end' in the above example should be  
> indented and also indentation should not be switched off because of  
> the cursor position.

Synedit adds or subtracts a 1 to the FirstLinePos, LastLinePos  
depending on various things. For example pasting one whole line or two  
whole lines gives the same range. And when you replace a line then  
FirstLinePos includes the line above that was not changed. So the line  
range is unusable for what I need.


Mattias





More information about the Lazarus mailing list