[SOLVED] string case label not colored lazarus / 9-Editor ---------------------------------------------------------------------- 440bx · 2024-02-24 19:25 Hello, It can be seen in the following code that case labels are not colored according to their type yet, they are in other statements (such as assigment).  Sample code (copy/paste into your version of Lazarus): 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 program CaseT; function test() : boolean;var  s      : string; begin  result := FALSE;   s      := '-1';     { strings are colored in the assignment statement       }  s      := '-2';   case ParamStr(1) of  '-1' : ;          { label not colored as string                         }    '-2' : ;     otherwise    begin      { note that '-1' and '-2' are colored in the writeln statement          }       writeln('neither ', '-1', ' nor ', '-2', ' entered');    end;  end;   result := TRUE;end; function test2() : boolean;var  i       : integer = 0; begin  result  := FALSE;   i := 1;             { numbers are colored in the assignment statement       }  i := 2;   i := ParamCount();   case i of    1 : ;             { label not colored as number                           }    2 : ;     otherwise    begin    { note that 1 and 2 are colored in the writeln statement              }       writeln('ParamCount may only be ', 1, ' or ', 2);    end;  end;   result  := TRUE;end;  begin  test ();  test2();end.                           The attachment shows the lack of coloring in the fixes branch of Lazarus (v3.1) Not sure if the lack of coloring is a bug but, it seems reasonable to expect the case labels to be colored according to their type  as they are in other statements. Useful comments welcome. ---------------------------------------------------------------------- KodeZwerg · 2024-02-24 19:45 Of course it looks different here ... ---------------------------------------------------------------------- Martin_fr · 2024-02-24 19:55 My first guess would be incorrect config... So lets check that. Tools > Options > Editor > Display > Color This page has a tree with colors, (when selecting "ObjectPascal" in the toolbar / selected by default)  the first section in that tree is "ObjectPascal" and it has an entry called "Case label". On my default 3.0 test install, all colors for "case label" are unset => and so they do nothig => and case labels show the underlying normal color. "Case label" can either be used to apply an attribute otherwise not used (maybe underline, maybe frame), or background color. Or it can be used  to mix colors using the alpha setting. Or it can be used to change color, but for identifier labels only. For that priorities of string/number color have to be set higher than "Case label". ---------------------------------------------------------------------- Martin_fr · 2024-02-24 20:03 As a bit of maybe useful info.... Colors (in the language section, e.g. "objectpascal") that are not explicitly set fall back to "default text" Except: Colors that (in the color editor) either offer an alpha channel, or on the font-attributes (bold...) have "on/off/invert" => those are modifier colors. The underlying code/text should already be covered by another color (in your case string or number), and can be further modified. (those work like the "bracket highlight" or "selection" color, and all other colors that are applied on top of Pascal colors) ---------------------------------------------------------------------- 440bx · 2024-02-24 20:10 Thank you KodeZwerg and thank you Martin. Martin your posts solved the problem.  I changed the "case label" foreground setting to "not modified" and that did the trick Also, the additional info, is important to be aware of.