NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Smarter Search (Find)


Joined: 20 Nov 2007
Posts: 14
Reply with quote
While I've fallen in love with PhpED since starting to use it a few months ago, I still consider the find mechanism to be incredibly annoying. A good search mechanism shouldn't require me to think about it every single time. Instead, PhpED confronts me with a dialog with four separate types of settings.

Here are just three suggestions that will smooth out search, making it easier and faster to use. They make search smarter by inferring the user's intention, instead of forcing the user to state the intention every single time.

1. It makes no sense to offer 'selected text' as a scope option if there is no current selection. Conversely, if there is a current, multi-line selection, then it makes a lot of sense to default the search to that selection, without asking up front. Instead, wait until finishing searching the selection and prompt the user to either cancel or search the rest of the file.

By doing this, you simplify the Find Text dialog box, plus you take advantage of working within the user's natural workflow.

2. I deliberately specified 'multi-line' in the previous item. Specifically, I mean if the current selection contains a newline. That's because if it doesn't, i.e. I've selected a portion of text on a line, then it makes more sense to use that as the default search term. This already works, kind of. If I have Find Text at Cursor enabled in the editor settings, and select a sequence of terms, that gets used as the default search string. This is exactly the right thing to do, and is the easiest way to search for something like $this->functionCall().

The problem, however, is that it only works when Find Text at Cursor is enabled. But anytime I do a search, the cursor is going to be somewhere. What are the odds of actually wanting to find the text at the cursor? Not tiny, but certainly not 100%. More like 10 or 20%.

If I have a substring on a line selected, use it regardless of the Find Text at Cursor option. If not, use my most recent search (which is more likely to be right). Personally, I'd get rid of the Find Text at Cursor option entirely, though I imagine there are people who would be annoyed by having to double click on a word to search for it elsewhere. But I'm not familiar with any other editors that have such an option (though I assume there must be some).

Again, this simplifies configuration so that new users don't have to play with a gazillion options. It just does what the user wants naturally.

3. Wrap around. This has been requested multiple times in the past, but still isn't there. Is there anything left besides the Windows Notepad that doesn't wrap search? It should be a no-brainer.

By implementing wrap-around, you get rid of a second block, the Origin block, on the Find Text box. You get the best of both worlds: It always starts at the cursor, and it always lets you search the entire scope. Instead of giving me a popup saying "Not found" with an OK button, it gives me a popup saying "Not found, Search from the beginning?" with a Continue from Top button and a Cancel button. You only ask about scope when it matters, not every time, plus it's a heck of a lot easier to hit a regular button than a radio button on a very frequently used operation, particularly if you have carpal tunnel problems.

Using shift-F3 to reverse the search direction doesn't cut it. You could have 100 occurrences of the target string in the file, with no idea whether the one you want is before or after the current location; you may not even realize there are 100 matches. If you go through 50 to get to the end of the file without finding it, you have to go through all of them in reverse or else figure out where you started some other way just to search the rest of the file. If you turn on Entire Scope, you have to remember to turn it off again next time, plus you don't get any sense as to whether the result you find is before or after the starting point.
View user's profileFind all posts by garyfxSend private message
Smarter Search (Find)
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic