Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLOSED] Incremental search while typing in the Find bar #1736

Open
core-ai-bot opened this issue Aug 29, 2021 · 4 comments
Open

[CLOSED] Incremental search while typing in the Find bar #1736

core-ai-bot opened this issue Aug 29, 2021 · 4 comments

Comments

@core-ai-bot
Copy link
Member

Issue by peterflynn
Saturday Oct 06, 2012 at 09:50 GMT
Originally opened as adobe/brackets#1781


This changes the Find (within file) feature so the first matching result is highlighted as you type, instead of after you press Enter. Navigating to subsequent/previous results still works the same as before.

Although highlighting all matches (mark occurrences) is turned off in our CSS, the changes here were tested & should work when/if highlights are made visible again.

Also includes some docs improvements.


peterflynn included the following code: https://github.com/adobe/brackets/pull/1781/commits

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Monday Oct 08, 2012 at 18:26 GMT


Very cool!

I notice a couple usability quirks with this:

  1. Incremental search does not recognize when typing a RegExp search argument. For example, I want to search on "THE" exact word matches, so my final search argument is "/\bTHE\b/" (without quotes). As I type, I see a hit on a forward slash (actually, I don't - see quirk 2), then no more hits until I type the final forward slash. I suppose some people may want to seach their doc for a forward slash, but I'm wondering if RegExp searches is common enough that the closing forward slash can be assumed?
  2. The Find (mini) dialog is displayed over the first 3 lines or so of the document, so if the first hit on the search is in that code, it is highlighted, but you don't see it. This can be fixed if you're in the middle of the file by scrolling the page, but I am not sure how to fix the case that it's in the first 3 lines of the file.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Monday Oct 08, 2012 at 18:30 GMT


Done with initial review.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Friday Oct 12, 2012 at 18:52 GMT


  1. Interesting point. We could assume that anything with a leading slash will be a regexp, but then do we assume the same thing when the search is finalized by pressing Enter? If so then we've changed the syntax (need to update the instructional label, etc.)... but if not, then there's an inconsistency between the search that runs as you type vs. when you hit Enter. I wonder if it's best to just wait until we have a better search UI (where presumably we'd have a RegExp toggle button/shortcut rather than a special syntax).
  2. The same bug exists before my pull request too. This is a general issue with how CodeMirror scrolls things into view (I see it all the time with Ctrl+T too). It's definitely annoying and I would love to fix it sometime soon, though :-)

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Friday Oct 12, 2012 at 20:01 GMT


Looks good. Merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant