On Mon, 8 Oct 2007 12:01:32 +0200
"Graeme Geldenhuys" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> Since my lastest SVN update (v0.9.23 r12367M i386-linux-gtk) Lazarus
> inserts a := after identifier completion (I think that is what it is
> called).  In r12329 it didn't.

Yes. New feature. But it needed a little tuning, when it should not add
it. I improved the known cases.

 
> eg:
>   I type:  FGrid.
>   A popup window appears, where I select a property and press enter.
>   Lazarus fills in the rest:   FGrid.ShowHeader:=
> 
> I have three issue here....
> 
> 1... How can I control Lazarus to not insert the :=

I added a checkbox in the codetools options.

 
> 2... The code formatting is not what I specified in CodeTools
> preferences. I want a space in front of the ':='   

It works here. It will add a space in front of := if you check 'Insert
space in front of' 'Symbol'.


> The same thing
> occurs when I type: OnShow := @FormShow;  and press Ctrl+Shift+C,
> Lazarus changes my code to OnShow :[EMAIL PROTECTED];   removing the space in
> front of the @ sign!!

Fixed.

 
> 3... In the CodeTools preferences screen you can tell CodeTools when
> to insert a space before or after a colon or equals sign etc...  How
> do I specify CodeTools formatting to _not_ insert a space in front of
> a single colon (eg: as used in parameters:  Param1: string; Param2:
> integer), but _do_ insert a space in front of a := (eg: as used in
> assignments:  Edit1.Text := 'some text';)

The codetools have the options (DoNotInsertSpaceInFront), but the dialog
does not allow to edit them, because this dialog should be kept simple.
Maybe someone wants to add an 'advanced' or 'more' options button/page.

BTW,
The built-in beautifier is a very simple thing, and we need a more
complete and more flexible beautifier. It needs the following features:

- beautify whole sources or parts of sources or new source, that will
be inserted.

- The beautifier should beautify context sensitive. That means when
beautifying a selection or insertion code, it should use the context
(e.g. the indentation in front).
For insertion code the codetools can pass some context information
to the beautifier. For example range and parts of the surrounding code.

- Every option (e.g. insert space in front of a := operator) should
have a flag, if it is a 'must' or a 'only on creation' option. 
For example if the codetools create new code, all options should be
applied. But if code is copied and pasted, then only the 'must' options
should be applied. 
For instance: the 'must' option can be: the line after
'begin' should be indented at least 0 spaces. And the 'creation' rule
can be 'indent 2 spaces'. This way copy/paste would not change:
    begin
    DoSomething;
    end;
But when this code is newly created it would indent the
line DoSomething;.
    begin
      DoSomething;
    end;

- It should have events to override or provide additional
information. For example the information what identifier is a keyword
depends on many things and can not always be determined ad hoc. For
example the keywords 'break', 'exit' can be variables.


> It's nice to have some intelligence in the IDE editor, but please
> allow the developer to decide what options they want and what they
> don't.  I'm a programmer, I like to type _some_ code. :)

AFAIK you recognize programmers, if they don't like / are too lazy to do
things again and again (e.g. typing) and instead write a program/tool.


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to