Find And Replace Dialog on VS2008, VS2010, and VS2012 express
-
Sunday, January 20, 2013 10:04 PM
Hello everyone,
A little background for who doesn't know:
if you click Ctrl+F3 in the middle of a text word or at the beginning of a text word in a source file, the code editor selects it automatically and if you continue clicking F3 all macthed words are searched against and eventually found (in VS2012 all matched words in a page are automatically highlighted after the first Ctrl+F3).
I'm not sure this is a bug but these are the steps to reproduce the issue:
A) VS2008
A.1) Open a source code file with content in it.
A.2) Select more the one line and click Ctrl+F
A.3) The "Find And Replace" Dialog appears. VStudio assumes you want to find some text inside the selection, so it selects the Selection option under the "Look in" combo box.
A.4) Write texts inside the Find And Replace Dialog. A simple word is fine, one you know there is more than one occurrence of it inside the source file but not inside the source text selected.
A.5) Click the Return key. Another dialog, about the failing search, sould appear. Click the Esc button three times, so to close the last dialog, the Find And Replace one, and to deselect the previous selection of multiple lines.
A.6) Now, if you click F3 to search the word you typed before (in the Find and Replace Dialog) VStudio will find the first occurrence along the flow of the document, but if you click again VStudio says there is no more of that word inside the document. That is wrong because there is more than one of that word.
I believe VStudio doesn't remove the Selection option inside the Find and Replace dialog (or whatever structure it has internally) after I removed the selection manually clicking on the Esc button.
- VS2010
the same as for VS2008
- VS2012 express edition
even worse. Equals to VS2008 and VS2010 steps except A.6 doesn't happen.
As I said before I'm not sure it is a bug but it is a contraddiction for sure. Contraddiction because if
the Find And Replace dialog is smart enough to preselect the Look In option to Selection value if I have selected some source text then I don't understand why it doesn't remove that option when I remove the text selected.
Thanks!
P.S I hope it is clear :), if it isn't just let me know.
All Replies
-
Wednesday, January 23, 2013 5:39 AMModerator
Hi CodeVisio,
The Find And Replace dialog is smart enough to preselect the Look In option to Selection value if I have selected some source text then I don't understand why it doesn't remove that option when I remove the text selected.
Do you mean that you want to move the options which are selected before? If so, you could move them from the Registry Editor:
HKCU\SOFTWARE\Microsoft\VisualStudio\11.0\Find
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
Wednesday, January 23, 2013 9:39 AM
Hi Jack,
No. Maybe I was unclear, sorry.
There is a "relation" between some operations in the editor and the Find dialog.
For example, if a select a word or the caret is on a word and press Ctrl+F the Find dialog appear. The word I selected or the word where the caret was on in the editor is automatically placed in the "Find What" field of the Find dialog.
Another example, if I select more the one line in the editor and press Ctrl+F the Find dialog appear. The "Look in" field is automatically set to Selection.
At this point I assume that this relation, between the editor and the Find dialog, is always held even when, as in the example in my previous post, I deselect the selection of multiple lines in my editor.
Unfortunately this doesn't happen and creates in my opinion "misunderstandings" in the coder.
VS2008 and VS2010: after I deselect text and click F3 the editor will search only for the next occurrences. If you press again F3 the editor says there is no more of that occurrences of that word. False, since there are many occurrences of that word in my tests. This is a bug in my opinion.
VS2012: After I deselect text and press F3 the editor says there are no more occurrences of that word. False, since there are many of them. I think the editor behaves so because it kepts the Selection value in the "Look in" field and since there is no more multiple lines of text selected it doesn't find anything. This is a partially coherency related to VS2008/VS2010 but still wrong. If I remove the selection of multiple lines the Selection value should be changed to Current Document.
Please keep in mind that here I'm not referring about the Find dialog but about the internal structure the editor use when I do these editing operations. Probably this structure ios aligned in some way with the Find dialog.
I hope it's clear.
Please follow the steps of my first post to see what happens.
Thanks
- Edited by CodeVisio Wednesday, January 23, 2013 9:40 AM
-
Thursday, January 24, 2013 4:58 AMModerator
Hi CodeVisio,
Glad to receive your reply.
Actually I’m still not very sure about this issue. To help you resolve this issue, to get the issue confirmed and diagnose by product team, would you please create connect report for it? You will get email notification for update.http://connect.microsoft.com/VisualStudio/feedback/CreateFeedback.aspx
As you said that it still has this issue in the latest VS version VS2012, so if possible, you could share us the steps to repro this issue in VS2012, please share us the screen shots about this issue, so it will be helpful for us to repro it. If you submit the connect report, you could share us the link here, if I get the same issue, I will help you vote it. Thanks for your understanding.
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
Thursday, January 24, 2013 8:48 AM
Hi Jack,
Thank you for you reply.
I'm having problem with your link and my account.
After clicked on the link, the web site said I need to complete my profile with addional information in order to be registered (Complete Required Registration Information). After clicked the Continue button the web page of my profile appeared. I don't know which important information the system required (bibliography? my web site?), however I filled in the fields and clicked the Save button. After that the system shown a web page with the following sentence "An unknown error occurred while processing your request. This is most likely due to a connection failure. Please try again.". Obviously, I tried many times the procedure with different values getting the same result. My connection is good for sure.
I don't think screenshots help us in this case since there is no messabox or a manifest error or the like, but a simple misbehaviour that I found not so coherent.
Let me know how to proceed. If you want you can submit the problem for me. The steps to reproduce the problem are in my first post.
Thank you
- Edited by CodeVisio Thursday, January 24, 2013 8:48 AM
-
Monday, January 28, 2013 2:28 AMModerator
Hi CodeVisio,
We're doing research on this case, it might take some time before we get back to you. Thanks for your understanding.
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
Wednesday, January 30, 2013 7:14 AMModerator
Hi CodeVisio,
Sorry for my delay.
if you click Ctrl+F3 in the middle of a text word or at the beginning of a text word in a source file, the code editor selects it automatically and if you continue clicking F3 all macthed words are searched against and eventually found (in VS2012 all matched words in a page are automatically highlighted after the first Ctrl+F3).
I try to check it in VS2012, it is the same result as the above contents
Like the following screen shots, the first is for the VS2012, the second is for VS2010.
A.1) Open a source code file with content in it.
A.2) Select more the one line and click Ctrl+F
A.3) The "Find And Replace" Dialog appears. VStudio assumes you want to find some text inside the selection, so it selects the Selection option under the "Look in" combo box.
I click the Ctrl+F in VS2012, and I just get the result like the screen shot1. So it seems that it doesn’t have the “so it selects the Selection option under the "Look in" combo box”
A.4) Write texts inside the Find And Replace Dialog. A simple word is fine, one you know there is more than one occurrence of it inside the source file but not inside the source text selected.
A.5) Click the Return key. Another dialog, about the failing search, sould appear. Click the Esc button three times, so to close the last dialog, the Find And Replace one, and to deselect the previous selection of multiple lines.
I input the text I want to find, and then I click “Enter” key, I didn’t get the dialog about the failing search, I just get a dialog about “Find reached the starting point of the search” when I click “Enter” key for a few times.
Not very sure whether I misunderstood this issue, but like the above steps, I couldn't repro this issue in my Environment, maybe you could try to check it in other Environment, so we could make sure that whether it is related to your VS. Of course, if I have misunderstood anything, please make free feel to let me know.
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Edited by Jack Zhai - MSFTMicrosoft Contingent Staff, Moderator Wednesday, January 30, 2013 7:15 AM
-
Wednesday, January 30, 2013 11:09 AM
(I cannot upload more than two images for each message, so I'll split the entire discussion)
===== Part 1 ================
Hi Jack,
no problem and thank you for your answer.
Sorry, I think it is my English. I'll try with screenshots.
This is my keyboard configuration for all three VSs:
VS2008:
Let's take the word "CDC" as an example. In the following screenshot the "CDC" word has many instances.
For some strange reason I have selected many lines as you can see and I have clicked Ctrl+F and inserted the word "CDC" and clicked on the Enter key. If you select more than one line in the code editor and click on Ctrl+F VS will select the Selection option in the "Look in" field of the Find And Replace dialog for you. Obivously in this example there is no "CDC" in the lines selected:
-
Wednesday, January 30, 2013 11:10 AM
===== Part 2 ================
Now, let's assume I did that by mistake and want to come back to the code editor for a normal search. So I click two times the Esc key to close the message box dialog and the Find And Reaplce dialog. Now I am on the code editor and I click a third time the Esc key to deselect the selection of multiple lines. Now your code editor should be similar to:
I removed my selection with the last Esc key click.
Now if you click F3 to continue the search for the "CDC" word VS will find the first instance of that word from the point where the caret was and you will have the following situation:
-
Wednesday, January 30, 2013 11:10 AM
===== Part 3 ================
VS is right. But if you continue the search clicking again on F3 key you will get the following message:
That is wrong. There are many instances of the "CDC" words there to look for.
That is the problem. I believe VS is wrong because it still keeps the "Selection" option in its internal structure.
You'll get the same behaviour for VS2010 too.
VS2012 instead it doesn't even try to find the word "CDC" the first time but it shows a the message box directly (I repea the above steps again):
- Edited by CodeVisio Wednesday, January 30, 2013 11:21 AM
-
Wednesday, January 30, 2013 11:11 AM
===== Part 4 ================
Clicking three times the Esc key to close the dialogs and the multiple line selection and clicking on F3 VS2012 will show:
Again, that is wrong. There are many instances of the word "CDC" there. I believe VS2012 keeps the "Selection" option active inside its internal structure.
Let me know if it is unclear.
- Edited by CodeVisio Wednesday, January 30, 2013 11:45 AM
-
Friday, February 01, 2013 9:12 AMModerator
Hi CodeVisio,
I think I could repro this issue now.
Actually you select some lines code with the mouse, and then you click the “Ctrl + F”, it still select the text inputted before, it will generated this issue when your Click “F3” like the following screen shot.
Of course, if possible, I suggest you don't select so many lines code, just select the specific text or one line code.
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Edited by Jack Zhai - MSFTMicrosoft Contingent Staff, Moderator Monday, February 04, 2013 8:04 AM
- Edited by Jack Zhai - MSFTMicrosoft Contingent Staff, Moderator Monday, February 04, 2013 8:05 AM
-
Friday, February 01, 2013 12:27 PM
Hi Jack,
Thank you for you answer and suggestion.
I used extensively the keyboard and shortcuts with VS. They allow you to code faster, especially during repetitive or iterative tasks. I think it is one of the great features of this IDE since VS6.0 or before. I'm incapable to work without them.
As I said before The Microsoft Connect web system doesn't recognize my account, so I'm unable to submit this issue. I don't care about who submit the issue, if you want and are able, please do it for me.
Best Regards
- Edited by CodeVisio Friday, February 01, 2013 12:28 PM
-
Monday, February 04, 2013 8:04 AMModerator
Hi CodeVisio,
Glad to receive your reply.
I’m afraid that this issue is by design, since if you change the two lines code to one line, it will work well.
You could submit this feature request: http://visualstudio.uservoice.com/forums/121579-visual-studio, since the Visual Studio product team is listening to user voice there. You can send your idea there and people can vote. If you submit this suggestion, I hope you could post that link here, I will vote it. Thanks for your understanding.
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
Monday, February 04, 2013 9:22 AM
Hi Jack,
don't worry, it's ok.
"since if you change the two lines code to one line, it will work well."
Obiviously. But it doesn't mean anything. :)
Jack,
If I develop some logical design with some physical code I need to be consistent in all cases otherwise the logic doesn't hold anymore.
If you select one line and click Ctrl+F the Find And Replace dialog won't show the "Selection" item value inside the "Look in" combo box. And so my example doesn't apply as well.
I'm surprised I'm the only one I noticed this flow.
Thank you for the link but my issues it's not an idea but a bug (I believe).
I tried to sign in with another account with a different e-mail but the system recognize me again with this actual account.
I would like to post this problem under microsoft connect. Do you know where I can post my microsoft connect account problem?
Thanks.
-
Monday, February 04, 2013 9:59 AMModerator
Hi CodeVisio,
Glad to receive your reply.
Maybe you could get some useful information from here :
You can browse some sections of the site without having to register. However in order to participate and get access to most things you need to sign in with a Windows Live ID and Register with Connect.
I will try to help you resolve this issue, if possible, you could try to open it with other Web browser. You need to sign in like the following screen shot, and then you would get the result like the second screen shot.
If still no help, I will try to help you submit this report. J
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
Monday, February 04, 2013 11:38 AM
Hi Jack,
Thank for you invaluable help.
I have submitted the issue to Microsoft Connect trough another web browser.
Thank you.
- Marked As Answer by Jack Zhai - MSFTMicrosoft Contingent Staff, Moderator Tuesday, February 05, 2013 1:28 AM

