Page 1 of 1

Comment Symbol with 'CTRL+B' not in front of indentation

Posted: Mon Sep 16, 2013 11:21 pm
by nalor
Hi!
Something really annoying is the following behaviour:

Code: Select all

If #True
   Debug "test"
   
   If Not #False
   EndIf
EndIf
When you select the line with 'debug' and press CTRL+B to mark it as comment it looks like this: '; debug "test"' (the comment symbol ';' is in front of the indentation)
In case you'd like to insert a new line into the 2nd if the whole line is moved to the beginning of the line because of the ';' from the comment being the first character in the line above.... destroying the complete indentation! (just position the cursor after the '#false' and press enter after commenting out the debug line and you'll see what I mean).

It would be better if a comment with CTRL+B would insert the ';' AFTER the indentation of the line - ' ;debug "test"'

Or maybe make this an option in the editor preferences.... but currently I don't know how I could stop this behaviour...

Thanks!

Re: Comment Symbol with 'CTRL+B' not in front of indentation

Posted: Mon Sep 16, 2013 11:30 pm
by Tenaja
I use tabs instead of spaces. That way, only the lines at the left margin (i.e. Procedure declarations and EndProcedure) have their indentation altered.

Re: Comment Symbol with 'CTRL+B' not in front of indentation

Posted: Tue Sep 17, 2013 5:34 pm
by nalor
Usually I also use tab's instead of spaces - but in my case this don't make a differnce when it comes to indentation? My example is working identically - regardless if I indent by tab or by space...

I think comment lines should simply be ignored by the indentation mechanism.

Re: Comment Symbol with 'CTRL+B' not in front of indentation

Posted: Wed Nov 06, 2013 5:17 pm
by Le Soldat Inconnu
Yes, when you comment ";" is placed on start line and not before indentation.
But when you reset indentation with Ctrl+I, ";" come back with good indentation

Example

Code: Select all

If Truc = 0
  Test + 1
EndIf
i comment

Code: Select all

If Truc = 0
;  Test + 1
EndIf
i set indent with ctrl + I

Code: Select all

If Truc = 0
  ;  Test + 1
EndIf
so i get indentation before and after !

The best solution for me :

Code: Select all

If Truc = 0
  Test + 1
  If Test > 2
    Toto = Test + 4
  EndIf
EndIf
i comment

Code: Select all

If Truc = 0
  ; Test + 1
  ; If Test > 2
  ;   Toto = Test + 4
  ; EndIf
EndIf
So, i keep indentation from fisrt commented line, and i keep indentation inside comment
if i do Ctrl + I, indentation don't change
if i remove comment, i don't lost indentation on line "Toto = Test + 4"

Thanks