Replace Text sometimes does not limit its scope to "Selected text"
I'm having this issue for a long time. Sometimes (rarely) when I select a text range and hit Ctrl+R it has Scope -> Global selected. I really can't reproduce it, but it happens eventually. If you don't notice that, bad things might happen. That's why I always check if Scope -> Selected text is chosen by hitting alt+s after ctrl+r window appears. That is annoying, and the problem is that if I file a bug, it will surely be closed as "Can not reproduce".
I am asking if anyone ever came across this issue? I come across it on diffrent machines, in different versions of OS and IDEA itself, thus this is not a concrete software/hardware setup problem. It just happens in 1 of 100 cases and bugs me.
Please sign in to leave a comment.
Selected Text is the default only when there's at least one newline in the current editor's text selection. Are you only experiencing this when the selection is entirely contained within a single line?
Randall Schulz
OMG, this is true! So simple and so true! Thank yout, Randall!
Indeed, select a text within a line and ctrl+r scope defaults to global. BTW, I'd say that this is incorrect behaviour. I really see no explanation to that difference. If I select a text range and hit "Replace" it's obvious that I want to replace inside selection only.
I've discovered this just recently and also noticed that it's only when a single line is selected.
And I agree that it should also select "selected text" in that case, instead of global scope.
I think the current behavior is just fine:
If I select a word, then I want to replace that word, not run a replace limited to scope
of the currently selected few characters.
-- Chat about IDEA in freenode channel #idea-users: http://webchat.freenode.net/
On 31.08.2010 18:01, Aardwolf wrote:
>
>
+1 I agree with Stephen current behavior is good.
If you triple-click a line, it will select the entire line, the scope is the selected text.
If you double-click on a word to select or use mouse/cursor to select a region of text, then Global scope is used.
I am assuming the issue is when you highlight a region of text? Do have a long line you are trying to replace text in?
Because that situation rarely comes up for me.