Folding in HTML?



  • Hi everyone,

    so I was able to figure out, that I can create my own keywords in the “UserDefinedLanguage”.

    However,
    by adding anything in the “Folding in comment style:” window,
    it allows me to fold comments.
    But it folds to the very end of my code/text?

    Also, is it possible to add this folding function into the already existing HTML language?

    Thanks in advance



  • @Name-Private ,

    But it folds to the very end of my code/text?

    For UDL folding in comment, it works just like described at https://ivan-radic.github.io/udl-documentation/folding-in-comment/ , which you can get to from the link in the UDL dialog:

    If I make a quick UDL that just defines comments
    like HTML comments:
    
    <!-- this is a comment -->
    
    Then I can use Folding in comment style, like
    described at https://ivan-radic.github.io/udl-documentation/folding-in-comment/
    
    <!-- openFold -->
    
    stuff here
    
    <!-- middleFold -->
    
    blah
    
    <!-- closeFold -->
    
    outside of folding-in-comment
    

    which if that UDL is active will show up as:
    469ad9e8-59dd-4b97-8731-c80d7520af18-image.png
    … and then when folded:
    489627f2-1473-44bf-addd-4603c6faf1f2-image.png

    Note that the folding begins and ends with the keywords defined.

    Also, is it possible to add this folding function into the already existing HTML language?

    You cannot combine folding from a UDL and folding in a builtin syntax highlighter like HTML, sorry. Only one lexer – either UDL or a builtin – can be active at a time.



  • This post is deleted!

Log in to reply