Page 1 of 1

Syntax Highlighting for Search Results

Posted: Mon May 05, 2003 6:43 pm
by Angantyr
It would be nice if this option was available for the Search Results "document class". It isn't a big issue, but for those who use Find in Files extensively (like I do) it would be a nice option. For example:

Without Syntax Highlighting:
Searching for: rsMain
Bb_rdr.h(335): #define TASK0RS_START rsMain
Bb_rdr.h(881): void rsMain(void);
rs485.c(52): * rsMain()
rs485.c(63): void rsMain(void)
Found 4 occurrence(s) in 2 file(s)

With Syntax Highlighting (Colors would be customizable--I'm not suggesting this color scheme!):
Searching for: rsMain
Bb_rdr.h(335): #define TASK0RS_START rsMain
Bb_rdr.h(881): void rsMain(void);
rs485.c(52): * rsMain()
rs485.c(63): void rsMain(void)
Found 4 occurrence(s) in 2 file(s)

Here's the catch...the standard syntax highlighting won't do the trick. As you can see from my example, I would want the highlighting to primarily apply to text generated by Textpad and not to the text it finds. Perhaps search matches within the line could be emphasized as such:

Bb_rdr.h(881): void rsMain(void);

The fact that normal syntax highlighting won't work is probably why the option is not enabled right now, but with a little coding I am sure you guys [TextPad] can do it! :D

long file names in search results

Posted: Wed Jun 04, 2003 4:38 pm
by jdpipe
My search results are hard to read because my file structure is deep. Syntax highlighting would help me to quickly see the stuff in the file that has been found.

Code: Select all

corelib\include\admin-pages\settings\menus\index.php(9): adminlist("menus","users");
corelib\include\admin-pages\settings\namedprivs\index.php(5): adminlist('namedprivileges','users');
corelib\include\admin-pages\settings\queries\index.php(5): adminlist("queries","users");
corelib\include\admin-pages\settings\reports\index.php(5):

Posted: Wed Jun 18, 2003 7:16 am
by Billi
That Highlightning sound really good and helpfull

:P

Yes Do It !!

Billi

Posted: Wed Jul 16, 2003 6:50 pm
by Tyriel
so you're asking for the syntax highlighting that applies to the source document to be applied to the document text in a search result as well? Or you want to be able to select the particular syntax definition that the Search Results class uses, and not have it inherit its highlighting from the source doc?

Posted: Sat Jul 19, 2003 1:14 pm
by jeffy
This is now implemented in 4.7. Is it done fully, as you intend?

Posted: Fri Aug 01, 2003 8:36 pm
by Angantyr
It wasn't done as I intended, but I made it work 99% the way I wanted it to by making a special syntax definition file for the search results window. The only flaw is that I was forced to used the ':' character as the comment delimiter, so it gets colored the same color as the found text. Not a big deal, as far as I'm concerned though. :)

I just sent the file to Textpad today, so hopefully it will appear in their list of syntax def files before too long. If you want to try it out now, here it is: http://members.cox.net/angantyr/SearchResults.syn

Here is a sample of how it turned out with my color scheme:
Image

Thanks Textpad!!! You guys rock!

Posted: Mon Aug 04, 2003 2:52 pm
by jeffy
Angantyr wrote:Here is a sample of how it turned out with my color scheme
Am using your color scheme. Like it a lot.

I'm using 149/196/149 as my comment color, though. Like it a bit dimmer.

Thanks! :' )

Highlighting matched text in search results

Posted: Wed Sep 17, 2003 11:53 pm
by Mark I.
I often do multi-file searches which return dozens or hundreds of matches, and it's common for matched lines to be hundreds of characters long. With lines that long, finding the text that matched can be like finding a needle in a haystack. It would be great if TextPad highlighted the actual matched text, not unlike Google's search term highlighting.

For me, this is TextPad's most-missed feature.

Posted: Thu Sep 18, 2003 5:37 pm
by jlacasse
Why is it when I change the colors for the search results doc class it changes the color settings for every other doc class as well.

Another suggestion

Posted: Thu Sep 18, 2003 6:09 pm
by Mark I.
I was thinking again about the problem of finding matching text in lines hundreds of characters long. How about this:

In each search result, TextPad highlights the text matched.

The current behavior (double-clicking the file name opens the file and positions the cursor at the start of the matching line) would be preserved.

Double-clicking the matched text opens the file and positions the cursor at the start of the *matched text* (and perhaps selects it as well).

Hmm, would this mean there should be two "Open All" commands, one that positions the cursor at the start of the line and one at the start of the matched text? That gets messy. Perhaps a global / document class setting?