Menu

#2128 Wrong folding mark for SVG file

Feature_Request
closed-fixed
nobody
5
2019-10-24
2019-09-22
No

Wrong folding marker of SVG

This is how Geany, which uses Scintilla, position the folding marker for SVG file:

Compare

1 Attachments

Discussion

  • Colomban Wendling

    As mentioned on the Geany report, this is not a bug, but maybe a feature request to add a lexer flag for folding on the first line of an XML open tag (the one with the <) rather than its last one (with the >).

     
  • Zufu Liu

    Zufu Liu - 2019-09-22

    It's a bug, maybe related to [bugs:#815].

     

    Related

    Bugs: #815


    Last edit: Zufu Liu 2019-09-22
  • Zufu Liu

    Zufu Liu - 2019-09-22

    A patch for this bug.
    Changed XML folding: XML doesn't has HTML-like void tags, so can be strictly start folding at tag-start, and end folding at tag-end.

     
  • Colomban Wendling

    @zufuliu How is this a bug rather than a feature resquest? From what I see the fold points are consistently at the end of the open tag. Moving it to the start of the open tag is a mere preference, and hides details of the opening tag, which some might not like.
    I think it's a valid feature request, but I'm not convinced it's a bug.

     
  • Neil Hodgson

    Neil Hodgson - 2019-09-26
    • labels: --> scintilla, xml, folder
    • Group: Bug --> Feature_Request
     
  • Neil Hodgson

    Neil Hodgson - 2019-09-26

    I agree with Colomban here, it is likely that some will want to see the details of the start tag, so this is a feature request for a preference.

     
  • Zufu Liu

    Zufu Liu - 2019-09-26

    Add a int option (only applied to XML, default to 0) like fold.xml.style ?

     
    • Neil Hodgson

      Neil Hodgson - 2019-09-30

      Possibly. fold.xml.at.tag.open?

       
  • Zufu Liu

    Zufu Liu - 2019-10-01

    Added the option, description based on Colomban's comment.

     
  • Zufu Liu

    Zufu Liu - 2019-10-11

    Fix folding bug for script tag in XML after these changes.

     
  • Neil Hodgson

    Neil Hodgson - 2019-10-17

    An example that exercises each change in level affected by the patch. Each number in the example is the index (with fold.xml.at.tag.open=1|0) of the level change in the set affected by the patch.

    <script>2|5
    var i = b
    </script>1|4
    
    <tag attr='2'
    attr='a'
    >|10
    data
    </tag>3|4
    
    <tag/>2 6
    </tag a>3|7
    <tag attr>2|8
    </tag >3|9
    <tag />2 11
    
     
  • Zufu Liu

    Zufu Liu - 2019-10-17

    That's strange.
    Don't figure out how to make fold.xml.at.tag.open and fold.flags=64(SC_FOLDFLAG_LEVELNUMBERS) works for SciTE.
    Screenshots for XML-Fold3.diff with hard-coded foldXmlAtTagOpen and fold levels take by Notepad2.

     
    • Neil Hodgson

      Neil Hodgson - 2019-10-17

      Looks like you aren't viewing line numbers in SciTE.

       
  • Zufu Liu

    Zufu Liu - 2019-10-18

    Same result with SciTE.
    Attached whole source and diff (with custom element on [feature-requests:#1299]).

     

    Related

    Feature Requests: #1299

    • Neil Hodgson

      Neil Hodgson - 2019-10-18

      Is this the change you want or the one on [feature-requests:#1299]? Why confuse the 2 issues?

       

      Related

      Feature Requests: #1299

      • Zufu Liu

        Zufu Liu - 2019-10-18

        I'm sorry, they are indeed separate issues.

        Attached full source for this issue only.
        The diff is same as XML-Fold3.diff on https://sourceforge.net/p/scintilla/bugs/2128/#7738

         
  • Neil Hodgson

    Neil Hodgson - 2019-10-18
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2019-10-18

    Committed addition as [54e1c9].

     

    Related

    Commit: [54e1c9]

  • Neil Hodgson

    Neil Hodgson - 2019-10-24
    • status: open-fixed --> closed-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2019-10-24

    Committed addition as [54e1c9].

     

    Related

    Commit: [54e1c9]


Log in to post a comment.

MongoDB Logo MongoDB