Sublime Forum

"In selection" icon should automatically get selected/glow, when I hit replace after selecting some text!

#1

The “In selection” icon should automatically get selected/glow, when I hit replace after selecting some text !

This is a very basic feature of any text editor, that it should detect whether a user has done some selection or not, when they bring up the Replace Dialog Box.

Serious damages can occur when replacements are done everywhere, instead of only in the selected text.

Hope this feature is implemented soon. Thanks.

0 Likes

#2

Whether Sublime Text finds text only in existing selections is controlled by "auto_find_in_selection" setting.

0 Likes

#3

I am referring specifically to the Replace Dialog Box, NOT being able to PRE-DETECT text selections, when invoked. Are you getting what I am saying ?

The “In Selection” icon should get turned on automatically, if any text selections are there.

0 Likes

#4

Search options are not changed automatically, but only by user interaction (either key bindings or clicking buttons), once the find/replace panel is open.

The region being searched (and replaced) within is defined by the selection when find/replace panel is opened and keeps unchanged until it’s closed again.

The "auto_find_in_selection" setting causes the “Search in Selection” button to be activated if selections are present when opening find/replace panel.

0 Likes

#5

Thank you @deathaxe for the details and lucid explanation.

Yes, the auto_find_in_selection setting works magically, if more than 1 line of text is selected, before Replace Dialog Box is invoked.

Also, Googling about this setting gave me further help here:

https://stackoverflow.com/questions/49125190/find-and-replace-within-selection-in-sublime-text-3/54163385

0 Likes