code completion for case statements with enumerated types lazarus / 9-Editor ---------------------------------------------------------------------- Syndrome · 2018-03-01 11:13 does lazarus support it? ---------------------------------------------------------------------- Martin_fr · 2018-03-01 11:19 you mean http://wiki.lazarus.freepascal.org/New_IDE_features_since#cod e_macro_OfAll ? ---------------------------------------------------------------------- Syndrome · 2018-03-01 11:44 Quote from: Martin_fr on March 01, 2018, 12:19:42 pmyou mean http://wi ki.lazarus.freepascal.org/New_IDE_features_since#code_macro_OfAll ? Yes. Thank you. Sadly, it generates unaligned code, but this is better than manually enumerating all the values. I left an alignment example below. It looks like the "code insertion" feature eats tabs - so i left comments describing the alignment. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure test_code_completion_for_case_statements;type        enumerated_type = (a, b, c, d, e, f, g);var        enum:enumerated_type;begin        case enum of {<- manually aligned case statement}                a: ; {<- aligned with 2 tabs}                b: ;   {<- aligned with 2 tabs}                c: ;   {<- aligned with 2 tabs}                d: ;   {<- aligned with 2 tabs}                e: ;   {<- aligned with 2 tabs}                f: ;   {<- aligned with 2 tabs}                g: ;   {<- aligned with 2 tabs}        end;      {<- aligned with 1 tab}         case enum of {<- auto completed case statement}        a: ;   {<- aligned with 1 space + 1 tab}         b: ;  {<- aligned with 1 tab + 1 space}         c: ;  {<- aligned with 1 tab + 1 space}         d: ;  {<- aligned with 1 tab + 1 space}         e: ;  {<- aligned with 1 tab + 1 space}         f: ;  {<- aligned with 1 tab + 1 space}         g: ;  {<- aligned with 1 tab + 1 space} end;     {<- keyword "end" aligned with 1 space}end; Do you know how to modify built-in macros? I could try to fix this myself. ---------------------------------------------------------------------- ASerge · 2018-03-01 20:11 Quote from: Syndrome on March 01, 2018, 12:44:28 pmI left an alignment example below. It looks like the "code insertion" feature eats tabs - so i left comments describing the alignment. Do you know how to modify built-in macros? I could try to fix this myself. Lazarus 1.8.2, Windows, x64. Auto completed case statement: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure Test;type  TEnum = (a, b, c, d, e, f, g);var  Enum: TEnum;begin  Enum := a;  case Enum of    a: ;    b: ;    c: ;    d: ;    e: ;    f: ;  g: ;  end;end;All correct. ---------------------------------------------------------------------- Syndrome · 2018-03-02 04:35 Lazarus 1.8.2. Windows 8.1 x64. All incorrect. I use tabs instead of spaces.