brackets-archive / bracketsIssues

Archive of issues in brackets.
0 stars 0 forks source link

[CLOSED] Remember last searched phrase & instant search paste fix. #10249

Open core-ai-bot opened 2 years ago

core-ai-bot commented 2 years ago

Issue by abose Thursday Oct 29, 2015 at 13:02 GMT Originally opened as https://github.com/adobe/brackets/pull/11869


fix: instant search doesn't work after ctrl+v on textfield Remember last searched phrase #11735


abose included the following code: https://github.com/adobe/brackets/pull/11869/commits

core-ai-bot commented 2 years ago

Comment by petetnt Friday Oct 30, 2015 at 07:57 GMT


Should the lastQueriedText persist over Find In Files only or during all the findbar events? (Normal CTRL+F, Search and Replace, Replace in Files...). Consider something like following:

  1. Find In Files -> "Hello world"
  2. Focus editor
  3. Reopen Find Bar -> it says "Hello world" (expected)
  4. Delete "Hello World", replace with "Hot dogs"
  5. Focus editor
  6. Reopen Find Bar -> it says "Hello world" again -> expected:

a) "Hot dogs" (persisting searches) b) Nothing? (the current default behavior (without Find in Files/Instant search))

I would be partial for all searches persisting (a))

There's another variation of the previous where it's even more mixed up:

  1. Repeat 1-3.
  2. Replace with something that exists
  3. Focus editor
  4. Find the next match with F3
  5. Open Find bar -> The last phrase persists
  6. Focus editor
  7. Open Find bar -> it's "Hello world" again

:+1: for this feature/fix otherwise

core-ai-bot commented 2 years ago

Comment by abose Tuesday Nov 03, 2015 at 13:08 GMT


Thanks@petetnt for reviewing. I have modified this to save last typed text irrespective of success of last executed query.

core-ai-bot commented 2 years ago

Comment by petetnt Tuesday Nov 03, 2015 at 16:51 GMT


Tested against https://github.com/adobe/brackets/commit/30716f4d765b87617cfc28cf1d0cae4106f0c3ef again and it fixes everything I mentioned in https://github.com/adobe/brackets/pull/11869#issuecomment-152453483 :+1: LGTM as it is.

Here's some food for though: should it remember the position of your search too? Consider something:

  1. Make a document
bar
foo 1
foo 2
bar
foo 3 
foo 4

Search for foo, cycle to the third foo and focus the editor on the bar -> Find-bar closes. Reopen Find bar. Is the expected highlighted one the closest one (the current implementation) or the 3rd one, the one you were in when you focused the editor. I think the latter would make more sense in most cases when the last searched phrase persists too.

core-ai-bot commented 2 years ago

Comment by abose Thursday Nov 05, 2015 at 09:37 GMT


I prefer the current implementation, the search progressing closest to the current cursor. That might be individual preference.

core-ai-bot commented 2 years ago

Comment by rroshan1 Thursday Nov 05, 2015 at 10:06 GMT


I have verified the changes. Looks good to me. Point to Note:- On reopening the "Find in Files" bar, any active selection would be given preference over the last remembered search. :+1: Merging the PR.

core-ai-bot commented 2 years ago

Comment by petetnt Thursday Nov 05, 2015 at 10:08 GMT


:cool:

core-ai-bot commented 2 years ago

Comment by abose Thursday Nov 05, 2015 at 10:58 GMT


Thanks all :)