Community
    • Login

    How to force UDL change to take effect

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 4 Posters 617 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.
    • gibberishbcG
      gibberishbc
      last edited by

      The UserDefLang editor is not fully intuitive, or documented. For the most part it is brilliant, but I can’t figure this out.

      When a change is made (for example, removing all the “middle” words in code folding1), what triggers the changes to take effect?

      I had this:
      Open:
      [if ]
      Middle:
      [((else elseif)) ]
      Close:
      [endif ]

      However, folding at an elseif (inside a nested if structure) would fold all the way down to the lowest endif

      So, I removed everything from the Middle field:
      Middle:
      [ ]

      But even after closing/reopening NPP, the elseif and else lines show the code folding indicators.

      How can I force this change to take effect?

      Lycan ThropeL EkopalypseE 2 Replies Last reply Reply Quote 0
      • Lycan ThropeL
        Lycan Thrope @gibberishbc
        last edited by Lycan Thrope

        @gibberishbc ,
        Insufficient data. You should post your debug information (?->Debug), so that folks that may help you have a better understanding of what you’re working with, and you should post code according to the Forum standards so people can see and work with the actual data that you really mean, rather than what you try to present here. Check this FAQ for learning how to post code, text so it shows exactly as you are dealing with it and how you want it to look.
        Some of your problem looks somewhat familar, like you are having conflicts with your UDL, but since we don’t know what is actually being worked with, because of your non-standard formatting and lack of debug information, it’s going to be a crapshoot what it is you really mean. You could have a plugin conflict as well, and the debug information would show that to the more knowledgeable users here to perhaps quickly identify the problem. Garbage in, garbage out. :)

        gibberishbcG 2 Replies Last reply Reply Quote 1
        • EkopalypseE
          Ekopalypse @gibberishbc
          last edited by

          @gibberishbc

          the document is updated as soon as the UDL dialog detects a change.
          Folding is a part of UDL where there are a few rough edges, but as @Lycan-Thrope mentioned, without more details it is hard to guess what exactly you have done and if this is a problem of UDL or your configuration.

          1 Reply Last reply Reply Quote 2
          • gibberishbcG
            gibberishbc @Lycan Thrope
            last edited by gibberishbc

            @Lycan-Thrope said in How to force UDL change to take effect:

            you should post code according to the Forum standards

            Yeah, odd about that…

            After posting the question, I realized I had neglected to CODE-ify (like that? Feel free…) the code snippet and immediately edited the post and surrounded code with triple-backticks (all edits completed within 3 or 4 mins), but there was no way to save - there was no SUBMIT button. So I puzzled around that for ten or so minutes, then called it a night. When I booted up this AM, the edited post was still in the editor, and now there was a submit button … but unable to save because “You can only edits posts for 180 minutes after posting” message.

            Thinking about it, I SUSPECT… the problem might be due to using the Brave browser. I’ll keep gerfingerpoken and confirm over time.

            As for the advice about the debug information, many thanks! I will do that next time (which will be very soon, probably).

            PS - I just edited this post - created it and am now editing it - using Google Chrome, and … No Problems. Suggest you guys test this forum with Brave Browser and then (if you confirm my observations/frustrations) add a disclaimer to the home page if this browser detected.

            1 Reply Last reply Reply Quote 0
            • gibberishbcG
              gibberishbc @Lycan Thrope
              last edited by gibberishbc

              @Lycan-Thrope
              HEre’s the debug info:

              Notepad++ v8.4.2   (32-bit)
              Build time : May 29 2022 - 16:45:17
              Path : C:\Program Files (x86)\Notepad++\notepad++.exe
              Command Line : $COMMAND_LINE_PLACEHOLDER$
              Admin mode : ON
              Local Conf mode : OFF
              Cloud Config : OFF
              OS Name : Windows 10 Enterprise (64-bit) 
              OS Version : 1903
              Current ANSI codepage : 1252
              Plugins : 
                  ComparePlugin (2.0.1)
                  EmmetNPP (1.0.2)
                  mimeTools (2.8)
                  NppConverter (4.4)
                  NppExport (0.4)
                  NppFTP (0.29.7)
                  NppQCP (2)
                  PythonScript (2)
              

              And here’s the structured code from the first question:

              I had this:

              Open:
              [if                                     ]
              Middle:
              [((else elseif))                        ]
              Close:
              [endif                                   ]
              

              However, folding at an elseif (inside a nested if structure) would fold all the way down to the lowest endif

              So, I removed everything from the Middle field:

              Middle:
              [                                       ]
              
              PeterJonesP 1 Reply Last reply Reply Quote 1
              • PeterJonesP
                PeterJones @gibberishbc
                last edited by

                @gibberishbc ,

                Since your two words, else and elseif, the else is also found in elseif, it will try the matches in order (from left to right), so else will match the else portion of elseif, and then (if you are in FOLDING1 instead of FOLDING2) the if will match the start of a new folding

                If you swap the order, so it’s ((elseif else)) , then it should do what you want (it fixed the folding for me by just changing the order).

                When working with multiple possibilities for matching (whether in regex for search/replace, or more simple combos like available in UDL), you must match the longer term then the substring, rather than the other way around.

                gibberishbcG 1 Reply Last reply Reply Quote 2
                • gibberishbcG
                  gibberishbc @PeterJones
                  last edited by

                  @PeterJones
                  Good catch - thanks!

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