Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Conversation

@abose
Copy link
Contributor

@abose abose commented Oct 29, 2015

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

@abose abose added this to the Release 1.6 milestone Oct 29, 2015
@petetnt
Copy link
Collaborator

petetnt commented Oct 30, 2015

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

👍 for this feature/fix otherwise

@abose
Copy link
Contributor Author

abose commented Nov 3, 2015

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

@petetnt
Copy link
Collaborator

petetnt commented Nov 3, 2015

Tested against 30716f4 again and it fixes everything I mentioned in #11869 (comment) 👍 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.

@abose
Copy link
Contributor Author

abose commented Nov 5, 2015

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

@rroshan1
Copy link
Contributor

rroshan1 commented Nov 5, 2015

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. 👍
Merging the PR.

rroshan1 added a commit that referenced this pull request Nov 5, 2015
Remember last searched phrase & instant search paste fix.
@rroshan1 rroshan1 merged commit 933b009 into master Nov 5, 2015
@rroshan1 rroshan1 deleted the abose/instantAfterPaste branch November 5, 2015 10:06
@petetnt
Copy link
Collaborator

petetnt commented Nov 5, 2015

🆒

@abose
Copy link
Contributor Author

abose commented Nov 5, 2015

Thanks all :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants