Community
    • Login

    Applying UDL formatting to the "Find All in Current Document" search results

    Scheduled Pinned Locked Moved General Discussion
    notepad++7.7.1udl
    5 Posts 2 Posters 1.4k Views 1 Watching
    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.
    • RatheriusR Offline
      Ratherius
      last edited by

      Hello!
      I have a UDL formatting style, it highlights some keywords in my log files.
      Besides, this highlighting does not work in the “Find results” field.

      I mean, for instance, the following case: a typical line in my file looks like “Monday, 01-01-1990”, “Tuesday, 02-01-1990” and so on; my UDL highlights word “Monday” with a yellow bg-color; I search for all even days of January, and in the “Find results” field I want to have all the words “Monday” (if any) to be highlighted according to the UDL.

      In fact, I am not experienced in UDL creating; I created my own one via the Notepad++ GUI.

      Could anyone give me some great piece of advice? Thank you!

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA Offline
        Alan Kilborn @Ratherius
        last edited by

        @Ratherius said in Applying UDL formatting to the “Find All in Current Document” search results:

        Could anyone give me some great piece of advice?

        Yes; you can’t do it.
        The Search results window has its own lexing (highlighting) independent of an editing window.
        You could, however, copy the text out of the Search results area and put it in a new editing tab, then specify the language for that tab to be your UDL and the desired formatting will appear there.

        RatheriusR 1 Reply Last reply Reply Quote 4
        • RatheriusR Offline
          Ratherius @Alan Kilborn
          last edited by

          @Alan-Kilborn thank you so much for your reply!
          Maybe there is some way to override the limitations of the “Find results” field? Some plugin or something like that?
          For instance, if it is impossible to apply the UDL to “Find results”, maybe I could somehow make the Notepad to open the “Find results” in a separate tab automatically?

          Alan KilbornA 1 Reply Last reply Reply Quote 1
          • Alan KilbornA Offline
            Alan Kilborn @Ratherius
            last edited by

            @Ratherius said in Applying UDL formatting to the “Find All in Current Document” search results:

            maybe I could somehow make the Notepad to open the “Find results” in a separate tab automatically?

            You could get that effect, but I wouldn’t exactly call it easy.
            Notepad++ offers scripting capability; see HERE for some info about that.

            The easiest approach might be:

            • do the search you want to conduct (see editor.search() or editor.research() functions)
            • open a new tab (notepad.new())
            • set the language of the new tab to your UDL (not sure how to do this as I don’t use UDL at all)
            • put the result of the remembered search results into the new tab (editor.setText())

            That’s a rather condensed version of what’s involved.

            RatheriusR 1 Reply Last reply Reply Quote 3
            • RatheriusR Offline
              Ratherius @Alan Kilborn
              last edited by

              @Alan-Kilborn I shall try it, thank you so much for your help! :)

              1 Reply Last reply Reply Quote 1

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors