Home Download Buy Blog Forum Support

"Whole Word" searches could be a bit smarter... [ST3]

"Whole Word" searches could be a bit smarter... [ST3]

Postby CrazyChoco on Mon Apr 08, 2013 2:37 pm

Try making a new blank document with the following text:
Code: Select all
    Hello
    World


If you enter the following in the search box:
Code: Select all
    Hello
    World

Then Sublime Text will find it with no problems.

However if you enable the "whole word" option then Sublime Text, then the search will fail to find any results.

I understand why this is happening. Looking at the error in the status message, it seems that if you enable the "whole word" option, Sublime Text just lazily slaps "\b"s around your search-text.

Could it be a little more intelligent, and only add a "\b" to the start and the end of your search text if the search text does actually start or end in a word-character respectively? Basically, "whole word only" should mean "if there search term starts or ends with a word, the whole word needs to match" - and not "only match search terms that start and end with a word". This is how most other editors work.
CrazyChoco
 
Posts: 7
Joined: Mon Apr 08, 2013 1:43 pm

Return to General Discussion

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot], Yahoo [Bot] and 17 guests