View Issue Details

IDProjectCategoryView StatusLast Update
0034410LazarusIDEpublic2018-10-15 02:20
ReporterVojtech CihakAssigned ToMartin Friebe 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformamd64OSLinuxOS VersionChakra 64-bit
Product Version1.9 (SVN)Product Build59293 
Target VersionFixed in Version 
Summary0034410: Wrongly highlighted and outlined code at some settings
DescriptionCode in Source Editor is highlighted wrongly in some specific settings.
This issue is not about highlighting of else/otherwise inside case..of statement.

var i: Integer;
begin
  case i of
    0: ;
    1: ;
    otherwise ;
  end;
  begin case i of
          0: ;
          1: ;
          else ;
        end;
  end;
  begin case i of
          0: ;
          1: ;
          otherwise ;
        end;
  end;
end;
Steps To ReproduceSee attachments. Settings and issue are:
1)
procedure: Markup
begin/end (procedure): Markup & Outline
begin/end (nested): Markup & Outline
case: Off

issue: "begins" are wrongly paired with "ends" of case..of statements.

2)
procedure: Markup & Outline
begin/end (procedure): Markup
begin/end (nested): Markup & Outline
case: Markup & Outline

issue: the last "end" is highlighted and the outline(s) are on bad position
Additional InformationLazarus 2.1.0 r59293M FPC 3.3.1 x86_64-linux-qt
TagsNo tags attached.
Fixed in Revision
LazTarget
Widgetset
Attached Files

Activities

Vojtech Cihak

2018-10-12 15:16

reporter  

outline_case1.png (23,570 bytes)
outline_case1.png (23,570 bytes)

Vojtech Cihak

2018-10-12 15:16

reporter  

outline_case2.png (22,911 bytes)
outline_case2.png (22,911 bytes)

Martin Friebe

2018-10-15 02:20

manager   ~0111403

Part 1 is fixed in r59297

Part 2 actually seems to be 2 issues:

a) The case is highlighted with the same color as the procedure.
  If the next outline was the "begin" then that would be correct.

b) If "Procedure" is enabled to be outlined, then the keyword "procedure" should be highlighted. The "end" (which belongs to both, the procedure and the begin) is correctly highlighted.


A fix for this is in r59298
a) "case" gets its own color
b) the procedure keyword will be highlighted

About (b)
Currently the procedure kwd only highlights, if the begin is not outlined.
But this is subject to further review and changes.

The suppression of coloring certain keywords was done, when the color config was hardcoded.
Now you can go to the color config, and separately change the vertical-line color and the keyword color. (so if you don't like keywords, then only config a color for the vertical line).

The only issue here is, that a "class" definition (or global "var" block, depending on settings) can use the same level/color as the procedure.
And nested procedures, use the same color as other blocks.
Still it is an rather arbitrary to handle "procedure" special.

Martin Friebe

2018-10-15 02:20

manager   ~0111404

Please test and close if ok

Issue History

Date Modified Username Field Change
2018-10-12 15:16 Vojtech Cihak New Issue
2018-10-12 15:16 Vojtech Cihak File Added: outline_case1.png
2018-10-12 15:16 Vojtech Cihak File Added: outline_case2.png
2018-10-12 18:41 Martin Friebe Assigned To => Martin Friebe
2018-10-12 18:41 Martin Friebe Status new => assigned
2018-10-15 02:20 Martin Friebe Note Added: 0111403
2018-10-15 02:20 Martin Friebe Note Added: 0111404
2018-10-15 02:20 Martin Friebe Status assigned => closed
2018-10-15 02:20 Martin Friebe Resolution open => fixed