Enter at beginning of line removes indentation

General questions regarding the usage of CodeLite
Sandman
CodeLite Curious
Posts: 7
Joined: Wed Apr 06, 2011 1:37 pm
Genuine User: Yes
IDE Question: C++
Contact:

Enter at beginning of line removes indentation

Post 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
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Enter at beginning of line removes indentation

Post 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
Make sure you have read the HOW TO POST thread
Sandman
CodeLite Curious
Posts: 7
Joined: Wed Apr 06, 2011 1:37 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Enter at beginning of line removes indentation

Post 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!
-- Sandman
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Enter at beginning of line removes indentation

Post 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
Make sure you have read the HOW TO POST thread
Sandman
CodeLite Curious
Posts: 7
Joined: Wed Apr 06, 2011 1:37 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Enter at beginning of line removes indentation

Post 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.
-- Sandman
tjulian
CodeLite Enthusiast
Posts: 32
Joined: Tue Nov 11, 2008 12:06 am
Contact:

Re: Enter at beginning of line removes indentation

Post by tjulian »

I also saw this behavior, and the attached patch fixes it for me.
You do not have the required permissions to view the files attached to this post.
Sandman
CodeLite Curious
Posts: 7
Joined: Wed Apr 06, 2011 1:37 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Enter at beginning of line removes indentation

Post 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,
-- Sandman
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Enter at beginning of line removes indentation

Post 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
Make sure you have read the HOW TO POST thread
Sandman
CodeLite Curious
Posts: 7
Joined: Wed Apr 06, 2011 1:37 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Enter at beginning of line removes indentation

Post 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,
-- Sandman
Post Reply