Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [photran] Automatic indentation

On Nov 30, 2005, at 5:58 AM, Miguel Hermanns wrote:

Hi,

Today some comments regarding the automatic indentation of the new editors (no highlighting today :-) ). First of all, is it possible to disable it or to modify its preferences?
Might be a good idea since right now its behavior might not suit everyone's preference.

I have some examples where the automatic indentation "fails", in the sense that it does not behave as I would expect. Both of them are extracts from my code:

The first one is the following:

!--------------------------------------------------------------------- -! ! Initialize_Problem ! ! ! !-------------------------------------------Miguel Hermanns-2005.11.28-!
subroutine Initialize_Problem(Initial_Time, Nodal_Values)
real, intent(out) :: Initial_Time
real, pointer     :: Nodal_Values(:)

The problem with this is that if I place myself at the beginning of the line starting with "subroutine" and press enter to add new empty lines, the line is indented with each enter I press.

I am not sure I follow this. I tried this out and this is what the code looks like:

1) subroutine Initialize_Problem(Initial_Time, Nodal_Values) [hit enter]

2) subroutine Initialize_Problem(Initial_Time, Nodal_Values)
	real, intent(out) :: Initial_Time [hit enter]

3) subroutine Initialize_Problem(Initial_Time, Nodal_Values)
	real, intent(out) :: Initial_Time
	real, pointer       :: Nodal_Values(:)

In the end the code looks like this:

subroutine Initialize_Problem(Initial_Time, Nodal_Values)
	real, intent(out) :: Initial_Time
	real, pointer       :: Nodal_Values(:)
	[cursor will be here, indented to the right]

If this isn't how it is supposed to look like, could you describe how it is supposed to behave? Would you prefer to have the line NOT indented after the enter (even if it sees the keyword "subroutine")? Or that it goes back to the leftmost margin if you enter a blank line by itself?

The second example is as follows:

!Imposes the specified boundary condition
select case(Type)
case(1) !Droplet surface

In this case I hit enter at the beginning of the line starting with "case(1)". Again, an indentation happens with each enter I press. But I want to add a new "case" before this one...

Right now the indentation is not context sensitive. Instead, it is based on keywords. In fact, if you enter "case" multiple times, it will look like this:

case(1)
	case(2)
		case(3)
			.....

Hopefully, tabs come out OK in this e-mail so I can illustrate my point.

Thanks for the feedback.

--Nicholas Chen




Back to the top