Page 1 of 1

smart indentation

Posted: Wed Jan 13, 2010 5:24 pm
by olafurb
I just started using Codelite and I think it's pretty great except for small pesky annoyances.

I am running revision 3584 on openSuSE 11.1

When smart indentation is enabled an extra indentation is added after I write a line that ends with a semi-colon and press enter.

void Class::ble( std::string fleh )
{
std::string str; <-- enter
[here is the caret]
}

I haven't been able to rectify this by fiddling around with the settings.
this is what I end up with
std::string bler;
bler = "adfasdf";
flflf->sdfdfyfy( asdfsdf );
if ( f3r3f3 )
{
bler = "dfefe";
}
else
{
bler = "fefef";
}

Does the source formatter have any say in this?

Best regards,
Ólafur Bergsson

Re: smart indentation

Posted: Wed Jan 13, 2010 6:34 pm
by eranif
Hi,

Please try to be more clear about the what do you expect, and what is the current behavior.

2 comments about posting here in the forum:
1) Use the pipe character '|' to indicate where do you expect the caret to be placed - it will be more clear
2) use the code tags to enclose code sections so it will be more readable

Also, there is an IRC channel #codelite at irc.freenode.net you might consider joining it for faster answher and some online help

Eran

Re: smart indentation

Posted: Wed Jan 13, 2010 7:41 pm
by olafurb
Hey,

Sorry about the previous post ... I didn't notice that the formatting went hay-wire

Code: Select all

void Class::ble( std::string fleh )
{
    std::string str; // enter
        | //caret is indented one indent too many
}
I haven't been able to rectify this by fiddling around with the settings.
this is what I end up with when I type normally without correcting the smart indent

Code: Select all

    std::string bler;
        bler = "adfasdf";
        flflf->sdfdfyfy( asdfsdf );
        if ( f3r3f3 )
            {
                bler = "dfefe";
            }
            else
                {
                    bler = "fefef";
                }

Re: smart indentation

Posted: Wed Jan 13, 2010 9:06 pm
by olafurb
I would like to add that I am using 4 spaces instead of tab

Best,
Olafur

Re: smart indentation

Posted: Wed Jan 13, 2010 9:53 pm
by eranif
Do you have your code enclosed inside braces?

Because codelite uses the current fold level to determine how much folding the code needs.

Maybe this approach needs to be revised

EDIT:
I fixed this issue in svn trunk it is now working as expected

Eran

Re: smart indentation

Posted: Fri Jan 15, 2010 7:56 pm
by olafurb
This is great ...
When do you plan the next release which would include this fix?

Re: smart indentation

Posted: Fri Jan 15, 2010 8:10 pm
by eranif
Releases are often made at around the 20th of each month

Eran