Menu

#1184 Different fix for #3292474

Bug
closed-fixed
Scintilla (812)
5
2011-08-03
2011-06-20
No

The change from bug #3292474 should be reverted as it causes vertical line to be drawn out of bounds and overlap with previously drawn marker on above line.

Let's take a look at screenshot from bug #3292474:

The first situation (left side of screenshot) will never happen with my changes from bug #3291579 (when you contract highest level fold header, sub lines of long wrapped line will not have anything drawn on them).

The second situation (right side of screenshot) can happen when you contract a nested fold header that's on long wrapped line, but in that case sub lines should not be highlighted at all, only the contracted (PLUS) marker at the first line should be highlighted.

I've attached a patch that should properly fix this. It handles highlighting in the second situation by highlighting only contracted fold marker on the fist line. The patch also modifies my previous fix for highlighting fold header markers on wrapped lines (bug #3291579, first item on the list) and implements it a little differently.

Illustrative screenshot is also attached.

Discussion

  • Marko Njezic

    Marko Njezic - 2011-06-20
     
  • Marko Njezic

    Marko Njezic - 2011-06-20
     
  • Jérôme LAFORGE

    Ok for the first situation, my fix #3292474 is no longer needed with your change from #3291579.
    For 2nd case, IMHO, it seems more clear for the user to keep this highlighted line because the wrapping line is into the contracted bloc. But it's just my point of view :)

    As you directly set tFold to undefined, I think you can also remove the block
    "if (!highlightDelimiter.isCurrentBlockHighlight(lineDoc)) {"

     
  • Marko Njezic

    Marko Njezic - 2011-06-20

    Regarding 2nd case, the highlighting of sub lines is not the real problem here. I think it looks confusing to just partially highlight vertical line marker and IMHO only first line should be highlighted in this case. Especially in order to be consistent with the way how highest level fold header is contracted (no sub line markers are drawn on wrapped sub lines). If you look closely, you'll see that last sub line is not highlighted all the way to the end of line, since vertical line marker from the next line was drawn partially on top of it, due to changes introduced in #3292474 (marker on line 163 in screenshot is drawn partially above marker on previous line). Vertical line should not be drawn outside defined rectangle and that's the main problem here.

    The "if (!highlightDelimiter.isCurrentBlockHighlight(lineDoc)) {" block should not be removed as it is the only place where HighlightDelimiter.isEnabled is being checked and I did not want to refactor source code more than needed.

     
  • Neil Hodgson

    Neil Hodgson - 2011-06-20
    • assigned_to: nobody --> nyamatongwe
     
  • Neil Hodgson

    Neil Hodgson - 2011-06-20

    I can see some validity with both choices and have no strong preference. If the tail is good (because you want an indication that the highlighted fold continues) then shouldn't there also be a tail on the first example where a top level feature is folded?

     
  • Marko Njezic

    Marko Njezic - 2011-06-20

    Tail should not be added when top level header is folded, as there is no tail when word wrap is disabled. It would look odd to have a tail and marker indicating contracted state. The same goes for sub level fold points, only first line of long wrapped line should be highlighted in order to be consistent.

    Anyway, the main problem here is the change to VLINE drawing, which made it draw outside it's boundary and that clashes with other markers. For me, only way to to fix this is according to the patch that I provided.

     
  • Neil Hodgson

    Neil Hodgson - 2011-06-22
    • milestone: --> Bug
    • labels: --> Scintilla
     
  • Neil Hodgson

    Neil Hodgson - 2011-06-22

    If the VLINE drawing is a distinct fix then it should have its own tracker item so it can be reviewed and committed separately. This is also better for people looking through Hg history.

     
  • Marko Njezic

    Marko Njezic - 2011-06-22

    Since VLINE drawing was changed in #3292474 and this item mostly talks about that particular item, VLINE changes should be discussed here.

    Other changes that fix header highlighting in second situation (so it's consistent with first) are added as an extra and they indeed would have been better if tracked separately, but what's done is done, no need separating now.

     
  • Marko Njezic

    Marko Njezic - 2011-06-23
     
  • Marko Njezic

    Marko Njezic - 2011-06-23

    I attached another screenshot (taken using vanilla 2.27 version of SciLexer.dll) that clearly shows why VLINE changes must be reverted, as they cause line to be drawn out of bounds.

    Handling fold sub header highlighting when line is wrapped is a different issue, which must be handled in some other way (other than drawing VLINE out of bounds).

     
  • Jérôme LAFORGE

    Sorry for the delayed response, I was in professional trip without Internet access.
    For the drawn out of bounds, IIRC it is easely (and only?) way to fix the problem describes into screenshot at #3292474 in case we keep tail on subline with wrap is enabled.
    If you decide to remove this tail for subline, this hack is no longer needed, and mainly with the pb with vanilla.

    > The "if (!highlightDelimiter.isCurrentBlockHighlight(lineDoc)) {" block
    > should not be removed as it is the only place where
    > HighlightDelimiter.isEnabled is being checked and I did not want to
    > refactor source code more than needed.
    Maybe you can remove "if (!highlightDelimiter.isCurrentBlockHighlight(lineDoc)) {" block and surround the remainder tests with "if ( HighlightDelimiter.isEnabled)". In my point of view, that seems most clear.

     
  • Neil Hodgson

    Neil Hodgson - 2011-06-24
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2011-06-24

    Removing the tail seems OK so this is committed.

     
  • Neil Hodgson

    Neil Hodgson - 2011-08-03
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.