George Newton
George Newton

Reputation: 3293

Sublime text find in selection

When I select multiple lines of text in text editor Sublime Text 3, and try to find (Ctrl+F) an existing string in it, it fails. In fact, any highlighting I do somehow makes the string unfindable. For example, if I highlight all text in my file, and Ctrl+F an existing string, it is unable to find any matches. Only when the string I want to find is not highlighted can the string be searched.

I have the 'in selection', 'highlight matches', and 'wrap' flags on when highlighting. My user preferences are as follows:

{
    "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
    "font_size": 10,
    "auto_find_in_selection": true,
    "trim_trailing_white_space_on_save": true,
    "ignored_packages":
    [
        "Vintage"
    ]
}

Any help will be appreciated. I have been trying to figure this out for an hour. Originally I had "auto_find_in_selection" set to false - I thought that was the culprit, but the problem persisted even after setting it to true.

Upvotes: 34

Views: 18069

Answers (2)

Sagiv Ofek
Sagiv Ofek

Reputation: 25270

go to settings-> user and add this line:

"find_selected_text": true

next time you select a text and press cmd+'f' it will be there as default search.

Upvotes: 52

chrisg86
chrisg86

Reputation: 11857

I had been fighting with this problem as well and for now (ST3 Build 3059) it still seems to be a bug. It seems like that the editor is not updating the selection for the search/replace bar while you have it open.

Here's a workaround:

1) Close the find/replace bar

2) Make your selection

3) Open search/replace bar and enter your search query

Hope this helps!

Upvotes: 31

Related Questions