# Refine search query suggestions \(\#3293\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/7586ef1787f96bc2a44b3d8928b66e61e03da574)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 7586ef1787f96bc2a44b3d8928b66e61e03da574

Requested commit: 7586ef1787f96bc2a44b3d8928b66e61e03da574

Commit: 7586ef1787f96bc2a44b3d8928b66e61e03da574

Tree: c1029bf6788bb06b8939f7bc1202c2bc60268668

Author: Max Brunsfeld

Committer: GitHub

## Message

````
Refine search query suggestions (#3293)

This PR fixes some issues in response to feedback from Dan Abramov and
Jose Valim.

To do:

* [x] fix non-word search suggestions
* [x] add setting for disabling search suggestions

Release Notes:

- Fixed an issue where opening a search without text selected would
populate the search query with non-word characters adjacent to the
cursor.
- Added a setting, `seed_search_query_from_cursor`, which controls
whether the search query is automatically populated from the buffer when
starting a new buffer search or project search.

By default, the search query will always be set to the word under the
cursor. If you want to only populate the search query when text is
selected, you can add the following to your `~/.zed/settings.json`:
  
  ```json
  {
    "seed_search_query_from_cursor": "selection"
  }
  ```

If you don't want the search query to be automatically populated, even
when there is text selected, add the following:
  
  ```json
  {
    "seed_search_query_from_cursor": "never"
  }
  ```
````

## Parents

- [31a6409a4c7f46a2121e655fa69ca83ca4cd9ad2](https://git.cafe/gitcafe/zed/commit/31a6409a4c7f46a2121e655fa69ca83ca4cd9ad2?format=markdown)

- [b6eef26f915aa8a4758d021d52add9e714b6f426](https://git.cafe/gitcafe/zed/commit/b6eef26f915aa8a4758d021d52add9e714b6f426?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/7586ef1787f96bc2a44b3d8928b66e61e03da574?format=markdown)
