[Bug?] Additional indentation caused by PB-KeyWord in Remark
Posted: Mon Dec 06, 2010 10:42 pm
I've defined an indentation KeyWord ";>" and ";<" which does a folding and an indentation of 2 tabs.
If I write a PB-KeyWord (e.g. DataSection) in the remarks following the defined indentation KeyWord, this will cause an additional indentation.
If the PB-KeyWord followes a KeyWord which just folds (e.g. ";{" ), it's fine.
I don't know if this could really called a bug (because this behavior is consistent, after any KeyWord which causes an indentation), but it doesn't seems really useful (or wanted) to me in remarks.
It's useful, that you can place an additional indentation KeyWord like ";>" after a PB-Command which already causes an indentation, but I think the indentation-check should exclude further indentation KeyWords in remarks.
e.g.
In the following example you can see how it affects the indentation within a code:
If I write a PB-KeyWord (e.g. DataSection) in the remarks following the defined indentation KeyWord, this will cause an additional indentation.
If the PB-KeyWord followes a KeyWord which just folds (e.g. ";{" ), it's fine.
I don't know if this could really called a bug (because this behavior is consistent, after any KeyWord which causes an indentation), but it doesn't seems really useful (or wanted) to me in remarks.
It's useful, that you can place an additional indentation KeyWord like ";>" after a PB-Command which already causes an indentation, but I think the indentation-check should exclude further indentation KeyWords in remarks.
e.g.
Code: Select all
DataSection ;> - 2 x indentation / useful
;> DataSection - 2 x indentation / not really useful
Code: Select all
; From the PureBasic.prefs:
;
; [Folding]
;
; Start_1 = ;>
; End_2 = ;<
; [Indentation]
;
; Keyword_3 = ;<
; Before_3 = 0
; After_3 = -2
;
; Keyword_4 = ;>
; Before_4 = 0
; After_4 = 2
;{ ----- DataSection (the keyword "DataSection" does not cause an indentation)
; --- <<< no additional indentation because of "DataSection" in Remarks
DataSection
; -----
EndDataSection
; ---
;}
; <<< The indentation of this Line is correct
;> ----- DataSection (now, the keyword "DataSection" causes an indentation)
; --- <<< additional indentation caused by the keyword "DataSection" in Remarks above
DataSection
; -----
EndDataSection
; ---
;<
; <<< The indentation of this Line is NOT correct