Page 1 of 1

Enter at beginning of line removes indentation

Posted: Wed Apr 06, 2011 1:54 pm
by Sandman
Hi! I'm a new user to CodeLite and like the IDE so far. Switched over from Code::Blocks and I definitely found it worth the effort of converting all my projects. :-)

I have one thing that I don't like so much and couldn't find an option for it. When I hit <enter> at the beginning of a line containing indentation, it removes the indentation. I can see why it makes sense, but it's just that I'm so used to editors not doing that. I would really like an option for this. :-)

Some pictures to explain better. Starting situation:
Image

After pressing enter, this is what CodeLite does:
Image

After pretting enter, this is what I would like as an option:
Image

Thanks!

-- Sandman

PS: I'm using v2.9.0.4684

Re: Enter at beginning of line removes indentation

Posted: Wed Apr 06, 2011 8:32 pm
by eranif
the fact that the 'int' in your sample is colored with black suggests that you are not using c++ lexer.
Did you try the above code on a file with a .cpp/c extension?

Anyways, this seems to work in trunk version of codelite.

Hopefully, sometime next week, I will find time to release new version of codelite

Eran

Re: Enter at beginning of line removes indentation

Posted: Wed Apr 06, 2011 8:50 pm
by Sandman
I noticed it using a .cpp file, I should have mentioned. :-) The example is just a new unsaved file.

Good it's already working, looking forward to the new release. Thanks!

Re: Enter at beginning of line removes indentation

Posted: Thu Apr 07, 2011 9:59 am
by eranif
Sandman wrote: The example is just a new unsaved file.
Your unsaved file is *not* of type .cpp (which changes how codelite's handle the indentation) - If it were a .cpp file, the 'int' would have been colored in blue (unless you changed it, and in that case ignore what I wrote)

Eran

Re: Enter at beginning of line removes indentation

Posted: Thu Apr 07, 2011 11:39 am
by Sandman
I'm trying to say that I noticed it when editing a different file, namely a .cpp file. I made this unsaved file just for the example. The behaviour is the same.

Re: Enter at beginning of line removes indentation

Posted: Thu Apr 07, 2011 5:47 pm
by tjulian
I also saw this behavior, and the attached patch fixes it for me.

Re: Enter at beginning of line removes indentation

Posted: Thu Nov 15, 2012 6:58 am
by Sandman
I just wanted to let you know that this is fixed for C++ files, but not for plain text files nor for Python files and maybe more. Using v4.1.5770.

Thanks,

Re: Enter at beginning of line removes indentation

Posted: Thu Nov 15, 2012 6:52 pm
by eranif
Sandman wrote:I just wanted to let you know that this is fixed for C++ files, but not for plain text files nor for Python files and maybe more. Using v4.1.5770.
Thanks,
There are no rules for text files indentation

About python etc: codelite does not support indentation for languages other than c++/c and PHP

Patches for other languages are welcomed

Eran

Re: Enter at beginning of line removes indentation

Posted: Fri Nov 16, 2012 11:27 pm
by Sandman
I don't want it to do any auto indenting things, I just want it to not change the indentation I have there. Look at the example: I would never expect it to remove the tab character there. If I am at the start of a line and I hit enter, I expect that line to move down and an empty line to be insert before it. I do not expect the line to be altered in any way.

Thanks,