Community
    • Login

    User Defined Language Different Number Styles

    Scheduled Pinned Locked Moved General Discussion
    udlstylesprefix
    4 Posts 2 Posters 1.4k 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.
    • David McD
      David Mc
      last edited by

      Hello all, I’m new here. I was wondering is there a way to add more than one style of numbers in a user defined language? I am trying to make a G-code language and i think all would work perfect if I could use the Number Style to assign different styles to plain numbers, numbers with a G prefix, numbers with a M prefix, numbers with a P prefix, numbers with an N prefix, etc. I believe I would need 8 different number styles. But I only see in the UDL editor where I can assign one number style.

      Is this possible? Could I manually edit the XML language file? Is this something that could be considered for a future software update soon?

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @David Mc
        last edited by

        @David-Mc

        No you can’t have different number styles.
        What you can do is to use the normal keyword lists with prefix mode like this

        1e21e539-134f-4d95-a58e-bd70fdf6307a-image.png

        Or you can use a python script like posted here.
        Which means you have to install the pythonscript plugin of course.

        1 Reply Last reply Reply Quote 1
        • David McD
          David Mc
          last edited by

          Okay, thank you for your response! I suppose i must look into the python script. The issue with using the keywords is a few machines I program remove spaces from the file so notepad++ just sees the entire line as one big long word and displays the entire line in that style. That is why the different number formatting would work perfect, but keywords not so much.

          Another way I could go is delimiters… is there a way to say close a delimiter on the last number digit before another character type? Have G, M, P, etc as delimiters and close on the last number digit because they always end with a number.

          EkopalypseE 1 Reply Last reply Reply Quote 0
          • EkopalypseE
            Ekopalypse @David Mc
            last edited by

            @David-Mc said in User Defined Language Different Number Styles:

            is there a way to say close a delimiter on the last number digit before another character type?

            Not that I know of.

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