Sublime Text: disable refresh/replacement in 'Replace' function?

161 Views Asked by At

using the "Replace..." [Find menu] function a slide-in at the bottom appears with an option field/entry for "Find:" and below that one, one for "Replace:"

having completed a replace [eg "Find: abc", "Replace: xyz"] for instance by employing "Replace All" the very slide-in disappears

now for another, new, search, for instance within a document having selected a different, let's say word like "oha", that selection 'oha' is auto-copied over as new entry in "Find:" when using "Replace..." again. this is to say that now in "Find:" the entry does read "oha" tho didn't paste it manually in -- the "abc" entry fromthe previous search got replaced

however, the last entry in the "Replace:"-entry-field remains unchanged

it's the "Find:" entry that get's auto filled in w/out the option [as far as i could figure out]

and that exactly is my question about : any option to modify Sublime's settings such that nothing gets changed/auto-copied/filled-in at "Find:" ?

pretty annoying behaviour, as i experience it, for instance when having to replace just a single character combi within similar text and each time the copy-selected text get's auto-copied/filled-in at "Find:" rather than leave it be till the usr opts to modify that entry from previous replace-calls

1

There are 1 best solutions below

1
On BEST ANSWER

The Find and Find and Replace widgets automatically populate the Find box with either the current selection if there is one, or the previous value used in that box. This box is a dropdown, which contains the previous values used, so you can easily go back through your history in that window and not have to re-type a complicated regular expression, for example.

When the Find box opens pre-populated with a value, it is automatically selected, so to get rid of it all you have to do is hit Backspace or Delete. Alternatively, you can just begin typing your new search query, and it will erase the old one.

There is a setting in Sublime Text 4 that modifies this behavior:

// If true, the selected text will be copied into the find panel when it's
// shown.
// On Mac, this value is overridden in the platform specific settings.
"find_selected_text": true,

If you set "find_selected_text": false, in your user settings, you can disable this behavior.