Syntax Highlighting for Search Results

Ideas for new features

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply

Syntax Highlighting for Search Results

Important, even if speed/efficiency is decreased/degraded.
9
30%
Somewhat important
7
23%
I'm okay either way
11
37%
Somewhat unimportant
3
10%
Unimportant, even if speed and efficiency remain unaffected
0
No votes
 
Total votes: 30

User avatar
Angantyr
Posts: 11
Joined: Mon May 05, 2003 5:45 pm

Syntax Highlighting for Search Results

Post 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
jdpipe
Posts: 3
Joined: Wed Jun 04, 2003 4:33 pm

long file names in search results

Post 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):
Billi
Posts: 9
Joined: Mon Jun 16, 2003 8:48 am
Location: Radebeul, Germany
Contact:

Post by Billi »

That Highlightning sound really good and helpfull

:P

Yes Do It !!

Billi
Tyriel
Posts: 25
Joined: Wed Jul 16, 2003 6:20 pm

Post 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?
~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~
-Steve Estes (Tyriel)
AIM: EnderW271
ICQ: 6854118
Email: destes[at]ix.netcom.com
User avatar
jeffy
Posts: 323
Joined: Mon Mar 03, 2003 9:04 am
Location: Philadelphia

Post by jeffy »

This is now implemented in 4.7. Is it done fully, as you intend?
User avatar
Angantyr
Posts: 11
Joined: Mon May 05, 2003 5:45 pm

Post 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!
User avatar
jeffy
Posts: 323
Joined: Mon Mar 03, 2003 9:04 am
Location: Philadelphia

Post 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! :' )
Mark I.
Posts: 2
Joined: Wed Sep 17, 2003 11:39 pm

Highlighting matched text in search results

Post 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.
jlacasse
Posts: 7
Joined: Thu Aug 28, 2003 5:28 pm

Post 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.
Mark I.
Posts: 2
Joined: Wed Sep 17, 2003 11:39 pm

Another suggestion

Post 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?
Post Reply