Sublime Forum

Inconvenient Replace dialog

#1

Refactoring source code with Sublime Text is very, very inconvenient. If you could please solve these problems:

[1] User changes a character of the “Find:” text in the Replace dialog. Result: Sublime Text performs “Unselect” in the main text editor.

[2] User enables “In selection” in the Replace dialog. Result: Sublime Text performs “Unselect” in the main text editor.

[3] User has done [2] and clicks “Replace All”. Result: Sublime unchecks “In selection”

These are all wrong assumptions made by Sublime Text about how the user will go on, and [1] and [2] exist in no other text editor. [3] is also not consistent because Aa and “” will not be reset.

1 Like

#2

Is there any chance they will try to improve the replace dialog? May I ask how you do basic refactorings across some languages unknown to the editor, or when you’re not fine with the refactoring tools available for the language?

2 Years went by and I have learnt to avoid the problems [1] and [2]. But [3] is still a problem. There’s also no keyboard short-cut (wouldn’t help much, when the reset always happens) for “In selection”.

And since Sublime resets it (why?) I need to use the mouse to re-enable it each time, and when I forget to do so, Sublime will consequently do the replacements in the whole file (!), even if there’s a selection and it looks like you would change only things in the selection.

:disappointed:

PS: What’s actually the point of [2]? Is it like “You want to replace things only in the selection? Okay, let me first remove your selection. Then please be sure that you make the exact selection you mean. Now please do that.”

Why’s it not just a boolean but an “action for beginners” or a “creative new way”?

But I guess everyone is fine with it, so I’ll try to move on.


Another, separate thing:

In Version 3.2.2, Build 3211 there is a problem (bug?) where Sublime does not replace at all - at first. Then I repeat the whole process Ctrl+H, set “In selection” to active again, and then it will do the replace. I can’t tell you all the steps / states to reproduce, but there’s probably some bug in this case.

All I can track this down to is this: It tells me (for quite a short time) in the status line that the search string could not be found. E.g. if I were to replace hello (whole words, case sensitive) by hallo in a selection, the first time Sublime won’t do it and the status line will display “could not find \bhello\b”. Then I open the dialog again by pressing Ctrl+H, re-enable “In selection”, create the selection again by using the mouse, and then Sublime is able to replace the hello.

I’ll try going upwards and downwards in the builds history, maybe I find a version that works for me.

0 Likes