Syntax Highlighting for Search Results
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Syntax Highlighting for Search Results
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!
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!
long file names in search results
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):
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?
~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~
-Steve Estes (Tyriel)
AIM: EnderW271
ICQ: 6854118
Email: destes[at]ix.netcom.com
-Steve Estes (Tyriel)
AIM: EnderW271
ICQ: 6854118
Email: destes[at]ix.netcom.com
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:
Thanks Textpad!!! You guys rock!
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:
Thanks Textpad!!! You guys rock!
Highlighting matched text in search results
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.
For me, this is TextPad's most-missed feature.
Another suggestion
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?
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?