• Login
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 727 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.
  • R
    Ratherius
    last edited by Jul 19, 2023, 10:10 AM

    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!

    A 1 Reply Last reply Jul 19, 2023, 11:56 AM Reply Quote 0
    • A
      Alan Kilborn @Ratherius
      last edited by Jul 19, 2023, 11:56 AM

      @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.

      R 1 Reply Last reply Jul 19, 2023, 12:17 PM Reply Quote 4
      • R
        Ratherius @Alan Kilborn
        last edited by Jul 19, 2023, 12:17 PM

        @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?

        A 1 Reply Last reply Jul 19, 2023, 12:35 PM Reply Quote 1
        • A
          Alan Kilborn @Ratherius
          last edited by Jul 19, 2023, 12:35 PM

          @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.

          R 1 Reply Last reply Jul 19, 2023, 1:25 PM Reply Quote 3
          • R
            Ratherius @Alan Kilborn
            last edited by Jul 19, 2023, 1:25 PM

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

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