Applying UDL formatting to the "Find All in Current Document" search results
-
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!
-
@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. -
@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? -
@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()
oreditor.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.
- do the search you want to conduct (see
-
@Alan-Kilborn I shall try it, thank you so much for your help! :)