Sublime Forum

Option to not close the Find Bar when the Replace All button is clicked


I have a purchased / registered copy of Sublime Text 3 (not sure if any feature difference between that and free version). I’m on v3.2.2-build-3211, which I believe is the latest available for my system (Linux Mint).

I would like to request a new setting to modify a side-effect of the Replace All button. I apologize if there is already some setting for this; I did look in settings/google but only came up with workarounds that weren’t quite the same. The behaviour I am seeing currently is that when clicking the Replace All button, the Find Bar is closed and I have to re-open it. The change I would like to request is to add a setting such as “auto_close_panel_on_replace_all”: true|false which if false would prevent the Find Bar from being closed when the user clicks Replace All. It appears to have the same behaviour regardless of whether regex is enabled or not.

The workaround I mentioned earlier was to remap a keybinding, but I would still prefer to have this behaviour on the button itself. I didn’t like the keybind option as that is slower for me and I am more likely to forget the keybinding whereas the button is quick, easy, and pretty hard to mess up even at the end of an all nighter.

Can’t accurately judge the level of effort without the code but based on the fact that the default keybinding already is using a boolean argument named close_panel, I suspect that adding a similar preferenceto control this behavior on the button as well may be fairly simple to implement.

	{ "keys": ["ctrl+alt+enter"], "command": "replace_all", "args": {"close_panel": true},
		 "context": [{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]

It seems that there are plenty of others interested in the same behaviour as well. Please see below links:

If more justification is desired for implementing this, consider that there are many cases where multiple replacements might need to be applied one after the other. Likewise, some regex replaces take multiple passes before all matches are exhausted in the document (especially true for complex matches that appear in a series).

1 Like


This would be really nice to have.



Another vote for this feature from me.


	// This determines whether the find panel is closed when the "Find All"
	// or "Replace All" buttons are pressed. Note this does not change the
	// keybinding behavior.
	"close_find_after_find_all": true,
	"close_find_after_replace_all": true,

Added 10 months ago in build 4092; they default to being turned on because that’s how Sublime has historically behaved, but can be turned off as desired in your preferences.