Recent

Author Topic: IDE Codetools space handling around brackets  (Read 3545 times)

Frederic Da Vitoria

  • Jr. Member
  • **
  • Posts: 73
IDE Codetools space handling around brackets
« on: June 25, 2013, 10:52:06 am »
Hello,

Currently the only options are to insert a space (or not) before or after brackets. These options do not distinguish between left and right brackets. This means we can ask the IDE to generate code like "foo(param);" or  "foo (param );" or  "foo( param) ;" or  "foo ( param ) ;" but not  "foo (param) ;" or  "foo( param );". Am I missing something?
davitof
Lazarus 1.0.10 + FPC 2.6.2 / Windows7 64bits

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: IDE Codetools space handling around brackets
« Reply #1 on: June 25, 2013, 11:23:52 am »
Do you really need this much spacing? You can also play around with fonts and colors, to make things readable. It is also rare that features are added for 1 person's taste. It is possible, but might stray far from any kind of standard, and generally accepted readable code. Remember that often times you need to show your code to other developers.

Frederic Da Vitoria

  • Jr. Member
  • **
  • Posts: 73
Re: IDE Codetools space handling around brackets
« Reply #2 on: June 26, 2013, 10:20:33 am »
I guess I really like it this way. This may be partially due to my being French, as French typographic rules put spaces before colons, semi-colons, question and exclamation marks and around quotes and braces. Also, Lazarus currently allows  "foo ( param ) ;" but I'd like  "foo (param) ;" which has less spaces  :)

Anyhow, I really don't understand the current space-bracket options. Why allow  "foo (param );" or  "foo( param) ," (the spaces in the last example are "triggered by the brackets, not the comma). I'd understand a merged option to put spaces around all braces, but left or right without discremating between opening and closing braces seems difficult to use.
davitof
Lazarus 1.0.10 + FPC 2.6.2 / Windows7 64bits

Zoran

  • Hero Member
  • *****
  • Posts: 1464
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: IDE Codetools space handling around brackets
« Reply #3 on: June 26, 2013, 01:37:20 pm »
Although personally I am not interested in using spacing with brackets, I must say that Frederic is right — using left only or right only space with brackets is ridiculous.

There should be separate options for space with left bracket, and for space with right bracket. Frederic, please file bug report.

Frederic Da Vitoria

  • Jr. Member
  • **
  • Posts: 73
davitof
Lazarus 1.0.10 + FPC 2.6.2 / Windows7 64bits

JD

  • Hero Member
  • *****
  • Posts: 1758
Re: IDE Codetools space handling around brackets
« Reply #5 on: June 26, 2013, 04:41:09 pm »
I guess I really like it this way. This may be partially due to my being French, as French typographic rules put spaces before colons, semi-colons, question and exclamation marks and around quotes and braces.

Vive l'exception française. Bienvenue à bord.  :D

JD
Windows (10, 7) - Lazarus 2.0RC3/FPC 3.2, NewPascal, Delphi

Indy 10.6 series; mORMot; Zeos 7.2.1; SQLite, Firebird, PostgreSQL & MariaDB; VirtualTreeView 5.5.3 R1