enturn / brackets-quick-search

Notepad++ style smart highlighting extension for Brackets editor.
36 stars 11 forks source link

Search is not case sensitive #12

Open Hirse opened 10 years ago

Hirse commented 10 years ago

Sometimes I use the quick search to see the other places I have used a variable or function. In most cases it proves very helpful. So thanks for this extension. ;)

Today I spent way too much time fixing a bug that resulted of me trying to use a variable that I spelled with lower case before. However the quick search was marking both as the same.

Below a screenshot of an example. quick-search

Is this the expected behavior? Personally I would prefer a case sensitive search to see non equal variable names more easily.

jamesjenner commented 10 years ago

I agree, this would be nice. However I think either it should be configurable. Optionally it could respect the current setting for case sensitivity on the standard search, though this may be hard to discover for users.

enturn commented 10 years ago

Yes, this is the expected behaviour but I can see how it can cause problems in that situation. Ideally you would have a compiler/linter that would check for those sorts of bugs.

I might be able to use standard search settings but you're right that it wouldn't be obvious to users. I could use a held key like ctrl/command to signify case insensitive search. I also might be able to change the colour of non-exact matches.

In the meantime it's easy to change to case sensistive. Go to main.js on line 112 and 115 and remove the 'i' regular expression option.

Hirse commented 10 years ago

I like your suggestions. A different color for non-exact matches is probably more obvious to the user.

I changed it to case sensitive in the code for me. Thanks for hint.

btw, even after reinstalling the extension, the main.js still contained the commented code you removed in the last update / commit.

enturn commented 10 years ago

Oops, sorry, the line numbers will be off then. I think I did cleanup after I uploaded to brackets repository and didn't reupload because no functionality was changed.

In committ ff545b73711e7a7335517384a18baacf2d8b13c0 I've made the highlight changes. I noticed a bug with using the find next key so I won't release until I fix that but you can get the changes from the repository.