Home Download Buy Blog Forum Support

[SOLVED] Problem with indentation

[SOLVED] Problem with indentation

Postby theprecursor on Wed Feb 13, 2013 8:49 pm

Hi,
I have a problew with automatic indentation after a doxygen commentary which is on the following model :
Code: Select all
/*
' '*
' '*/

After this commentary, indentation of 1 space is not reset as you can see on the following picture :
Image

There is a reset when there is no space at the beginning of the lines of the commentary :
Image

On the two previous pictures, I used reindent on the whole source code.
I tried to modify the config file containing regalur expressions without success...
The problem is present (at least) with C et C++ files.

If someone has a idea to help me :)
Last edited by theprecursor on Thu Feb 14, 2013 11:02 am, edited 1 time in total.
theprecursor
 
Posts: 4
Joined: Wed Feb 13, 2013 8:37 pm

Re: Problem with indentation

Postby theprecursor on Wed Feb 13, 2013 10:40 pm

It seems that when the string "/*" is recognized, indentations rules are not called.

When I add the following regular expression to the file Indentation Rule (for c++) :
Code: Select all
|       ^ \s* \*\n .* $


I can decrease the indentation after recognition of "*n"
But if I changed the previous rule to
Code: Select all
|       ^ \s* \*/ .* $

the string "*/" does not receive any handling...
theprecursor
 
Posts: 4
Joined: Wed Feb 13, 2013 8:37 pm

Re: Problem with indentation

Postby theprecursor on Wed Feb 13, 2013 11:03 pm

I think that if I find how to desactive auto alignment at the same level with spaces when I press Enter, my problem could be solved... :cry:

In fact, I only need auto tab, but I want to do spaces by myself if necessary
theprecursor
 
Posts: 4
Joined: Wed Feb 13, 2013 8:37 pm

Re: Problem with indentation

Postby theprecursor on Thu Feb 14, 2013 11:02 am

Finaly, I found a solution by retesting my previous attempts...
I replaced \s by . and it works !
It seems that spaces are not recognized by the regular expression \s*.

If someone has the same problem than me, my solution is the following :
Preferences -> Browse Packages -> C++ -> Indentation Rules.tmPreferences
then add
Code: Select all
^ .* \*/ .* $
to decreaseIndentPattern.

The first rule
Code: Select all
^ (.*\*/)? \s* \} .* $
was not sufficent cause a bracket was expected :geek:
theprecursor
 
Posts: 4
Joined: Wed Feb 13, 2013 8:37 pm


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot] and 33 guests