Community
    • Login

    Seperate styler from delimiter

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 345 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • LPS100OfficialL
      LPS100Official
      last edited by

      Hello, I’m writing a BBCode-esque Language to make Flight Rising descriptions easier to write, and so far it’s pretty solid - I’m able to fold columns and lists, and highlight different BBCode in different colors. https://i.imgur.com/KMrBm5t.pngExcept there’s one minor problem and it’s I can’t fold indent.

      I have each BBCode as delimiters by doing Open: [u [/u then Close: ] ] because it’s the… only way I managed to get the language to work the way I hoped to achieve, but because I have [i] [/i] under delimiters, trying to add [indent] [/indent] in folding is overwritten by [i] [/i] delimiter all because both start with [i. If I do Open: [ [ and Close: i] /i], it messes with everything, removing the [i] [/i] from the delimiters fixes it but I too want to hightlight [i] [/i]. And I have yet to figure out how to make the Operators work with the Keywords and Delimiters, I read the entire document and I still have no idea.

      I was wondering how do I seperate them to allow [indent] [/indent] be foldable but also highlight [i] [/i]? Or better yet, if anyone has a better format/organization for the language to get what I hope to achieve work? Here’s the format and the delimiters, the ----- is under keywords as a non-prefix.

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @LPS100Official
        last edited by

        @LPS100Official

        Delimiters are meant when you want the contents between a pair of tokens, along with those tokens, all syntax-highlighted the same color. So if you wanted all of [i]random text in here[/i] to be the same style, then your open delimiter would be [i] and your close delimiter would be [/i]. But since you seem to not want the stuff in between to be colored/styled, just the tags themselves, then I would say “don’t use delimiters for those”. You would just make [i] and [/i] as keywords

        About the only one, in your examples, that would make sense as a delimiter would be [url as the open and ] as the close, because you want [url=blahblahblah] to all be the same styling.

        BTW: the User Defined Language Repository already has a BB Code UDL: you might want to look at how they did it

        LPS100OfficialL 1 Reply Last reply Reply Quote 0
        • LPS100OfficialL
          LPS100Official @PeterJones
          last edited by

          @PeterJones Ohhh, that’s why that’d happen, makes so much sense now. And the other BB Code xlm helped out on a few things, thank you very much! :D
          00b0f6a8-f76f-4285-8a71-2b80e1135373-imagem.png

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors