locked
VS Editor Text Search Problem RRS feed

  • Question

  • Hi Folks:

       Developing on Win 10 Pro, VS 2017 Community Edition. 

       One of the many things that I dislike about developing Windows code is performing text searches with the editor. 

       Suppose I want to go to the first occurrence of a piece of text, say "base_bold_font_tm", in a function, after searching for it a couple of times. 

       Since I want to find the first occurrence I'll set the cursor above where I know it will be in the text:

       Here I actually select the function's name before I start the search. 

       I'd expect a search to take me to the text at line 10:

       Instead it skips over the search text on line 10 and 15 and finds the text on line 18. 

       I'd done a couple of searches and found those two instances of the text, but I'd like to find the first one again.

       So I'll try it again, setting the cursor at the top of the function, which looks like the first picture, and search again:

       Now it skips 3 instances of the text and settles on line 21. 

       If I wanted to find the search target following the one I'd just found, I'd leave the cursor on the target that's just been found and hit <F3> again.  If the cursor is moved to another location I want to search to start from there.

       Sometimes searches seem to find the first occurrence of the text after where I place the cursor, other times they move me to some remote part of the source code where I have to take time to figure out what I'm looking at. 

       I haven't noticed this until VS 2017.  Is this a bug, or someone's idea of how searches should really work?

       I've looked at the Tools menu item, but I don't see a section for searches in the Text Editor section. 

       Is there some way to have the search find the next target, or previous target, from where I place the cursor?

          Thanks
          Larry

    Sunday, July 30, 2017 7:12 AM

All replies

  • You can add buttons in the toolbars (at least with VS 2015)

     =>

    Sunday, July 30, 2017 7:25 AM
  •    I haven't noticed this until VS 2017.  Is this a bug, or someone's idea of how searches should really work?

    I don't get that behaviour Larry, search finds the next item after where I've clicked.

    Do you have any 3'rd party addons installed that may be causing this odd behaviour?

       Is there some way to have the search find the next target, or previous target, from where I place the cursor?

    The defaults of F3, Shift+F3 should do that.

    Dave

    Sunday, July 30, 2017 11:12 PM
  • Thanks Dave and Castorix31:

       Everything is stock, no addons. 

       It's working fine right now, but I've seen this behavior before and I'm sure I'll run into it again. 

       Has anyone else seen this? 
    Monday, July 31, 2017 3:19 AM
  •    Has anyone else seen this? 

    Hello,

    sometimes I see this strange search behaviour too.

    As far as I found out, it sometimes happens when I already searched for the same string before. It seems as if VS saves the last found position and starts searching from this position instead of from cursor position. But it does not always occur. Must be a bug in VS.

    Sometimes it helps when I close the search window and restart search again. Then it starts from cursor position.

    Regards, Guido


    Monday, July 31, 2017 9:20 AM
  • sometimes I see this strange search behaviour too.

    Thanks Guido:

       It helps to know I'm not the only one seeing this. 

       It happens too often, but infrequently enough that I'm not expecting it. 

       I sometimes search for some text, change it, only to find I've changed something in a different function than the one I thought I was in. 

       Visual Studio has a lot of nice features, but after developing Windows code for about 15 years I still miss the smooth, productive and joyful experience I once knew writing C++ for Solaris. 

       I appreciate your response. 

          Larry




    Monday, July 31, 2017 5:05 PM
  • Hi Again:

       Searches have been working fine for the last week, but this behavior is back today. 

       Closing Visual Studio and re-starting it doesn't help. 

          Larry

    Saturday, August 5, 2017 11:53 PM
  • Make sure to mention the exact VS 2017 version. Like, "15.2 (26430.16)". Otherwise we have to guess...

    -- pa

    Sunday, August 6, 2017 1:13 PM
  • Make sure to mention the exact VS 2017 version. Like, "15.2 (26430.16)". Otherwise we have to guess...

    -- pa

    Thanks Pavel A:

            Microsoft Visual Studio Community 2017
            Version 15.2 (26430.6) Release
            VisualStudio.15.Release/15.2.0+26430.6
            Microsoft .NET Framework
            Version 4.7.02053

        Searches seem to be working today.

    Monday, August 7, 2017 12:08 AM
  • Hi,

    thanks for posting here.

    Has your case been solved? If it has, please help to mark answer. If you have any other concerns, just feel free to contact us.

    Your understanding and cooperation will be grateful.

    Best Regards,
    Sera Yu


    MSDN Community Support<br/> Please remember to click &quot;Mark as Answer&quot; the responses that resolved your issue, and to click &quot;Unmark as Answer&quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact <a href="mailto:MSDNFSF@microsoft.com">MSDNFSF@microsoft.com</a>.

    Tuesday, August 8, 2017 7:51 AM
  • Hi,

    thanks for posting here.

    Has your case been solved?

    Hello Sera:

       I don't believe my case has been solved. 

       Sometimes the editor searches fine, sometimes Guido Franzke and I have problems with the editor's search.  

       I haven't found a work around, short of saving all, quitting Visual Studio, shutting everything else down, rebooting, logging in, unlocking BitLocker for each of my drives, setting everything up and continue the edit session. 

       If you feel that's a solution, or there's nothing else to be done, go ahead and mark this as answered.  I'd rather not. 

       I appreciate all the assistance you folks offer us and your desire to be able to put a "Solved" mark on each post.  Without your help writing C++ applications for Windows would be very difficult.   

          Thanks

          Larry



    Wednesday, August 9, 2017 7:06 PM
  • Hi Larry,

    Ok, I understand your request.

    For your case, I will suggest you these operations.

    1. You could install the latest vs2017( version 15.3) to see if this works.

    2. If you want to know the functionality of this feature, you could post on VS general forum for better support.

    3. If you want to post a bug to Microsoft, you could connect to Microsoft and post on it.

    Hope this could be help of you.

    Best Regards,
    Sera Yu


    MSDN Community Support<br/> Please remember to click &quot;Mark as Answer&quot; the responses that resolved your issue, and to click &quot;Unmark as Answer&quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact <a href="mailto:MSDNFSF@microsoft.com">MSDNFSF@microsoft.com</a>.

    Thursday, August 17, 2017 7:40 AM