Sublime Forum

Allow Locking the Search Field

#1

FEATURE REQUEST: a button in the search bar that locks the contents of the search field, so that the search pattern doesn’t change due to editing operations that involve selections.

When editing files I often use the search feature to quickly navigate code sections via given keywords (e.g. functions definitions, etc.). Then, when editing the actual code in the various sections, I often use Ctrl+D to select whole words and multiple occurences of that words.

The problem is that using Ctrl+D alters the search field, and if used multiple times the original search pattern will no longer be available in the search field dropdown history. Other editing operations might change the search pattern too.

I think it would be useful to have a button to lock the contents of the search field, so that similar selection operations won’t change it and the original search pattern is preserved and remains available to quickly find the next/previous occurence.

The above scenario should be quite typical — i.e. one uses a search RegEx to quickly navigate documents via specific patterns, in order to do some code cleanup chores. Loosing the search pattern then becomes a bothersome inconvenient, forcing to retype the whole pattern from one section editing to the other. If the pattern is long, currently the easier solution is to have a text file with the pattern selected, and then use Ctr+F to start searching using that pattern.

Indeed, being able to lock the search field would be more practical.

1 Like