Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Reset search query when initialised #807

Merged
merged 3 commits into from Mar 3, 2017
Merged

Reset search query when initialised #807

merged 3 commits into from Mar 3, 2017

Conversation

Alhadis
Copy link
Contributor

@Alhadis Alhadis commented Nov 9, 2016

Redux of #762, which I closed after deciding the fix was too trivial to warrant another entry in the Atom team's creaking PR backlog.

Reopened after I lost ~10 minutes thinking a log hadn't been updated (and trying to debug why), only to realise I was being bitten by this bug the whole time. I realised there're probably many more users who're getting false negatives after rerunning a search at startup, which could cost them pointless time too...

/cc @maxbrunsfeld


Steps to reproduce

  1. Open a project file in Atom, and search for something that will match
  2. Close project
  3. Reopen project and project's file
  4. Bring up the buffer search and enter the last search term verbatim. This should be done quickly, either by typing fast or pressing the Up Arrow key to access search history.
  5. Hit Enter

Expectation: Markers should appear in the buffer
Reality: The program beeps at you as if the field was left blank

Setting findPattern at startup prevents a user from rerunning their last
query at startup. Because the object given to BufferSearch's onDidChange
handler reports no change, its recreateMarkers method won't be called.

This is handled in the specs by supplying the findOptions object a dummy
string (reproducing a more realistic startup state). Without this patch,
the first spec would fail.
@50Wliu 50Wliu self-assigned this Mar 3, 2017
@maxbrunsfeld
Copy link
Contributor

Thanks @Alhadis! Sorry for letting this linger!

@maxbrunsfeld maxbrunsfeld merged commit 90b1eb5 into atom:master Mar 3, 2017
@Alhadis Alhadis deleted the state-reset branch March 9, 2017 13:04
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.

None yet

3 participants