1

Topic: Problem when seach forward ('/') finds match in quoted string

VS2010 sp1.  ReSharper 6.1
C# file.
When a search finds a match w/i a quoted string, pressing "Enter" to end the search inserts extra quotes ?!
Search for "unrecogni", match found in this line:
                                Debug.WriteLine("Unrecognized property " + property.Name);
When I press 'enter' to end the search, I end up with this:
                                Debug.WriteLine("" + "Unrecognized property " + property.Name);
Pressing 'esc' cancels the search, and returns the cursor to wherever it was when the search started.

2

Re: Problem when seach forward ('/') finds match in quoted string

I have the same issue. I think it may have started after a Visual Studio 2010 update, but I'm not sure. It'

3

Re: Problem when seach forward ('/') finds match in quoted string

I'm seeing this issue as well. It is a pretty major inconvenience--enough that I think it warrants a patch (I'm not prepared to live with the issue until the next major release).

4

Re: Problem when seach forward ('/') finds match in quoted string

From looking around, it appears to be an issue with ReSharper hooking the Enter key...  Here's one of the bug items on the ReSharper bug tracker...

http://youtrack.jetbrains.com/issue/RSRP-200918

Best I've been able to determine, and it appears to happen under different conditions:
XML Comments ///  - seems to do it all the time here
String Literals - does it if the text you're searching for is within the string, but if you include the leading or trailing " it seems to work properly so it appears to be contextual here.

The bug only triggers if the text you're searching for appears in a /// comment or a string first.  If, on the other had, the search item exists in code or a normal comment first, it can find the text with no problems even in a comment area or within the string

So in the example used by Number8 above, if you searched for
"Unrecogni
With the quotation as part of the search ( /"Unrecogni )
it would work properly

5

Re: Problem when seach forward ('/') finds match in quoted string

Found a workaround... You have to do 2 things.  First, make sure you start your search outside of a string literal or an XML comment as ReSharper is still hooking the Enter key and will insert a newline.  Second item, disable incremental search in VIEmu so that VIEmu is able to consume the Enter before ReSharper (of course you lose the instant search as you type, but better than having to use the Find/Replace menu option)

To disable the incremental search in VIEmu, the command is
:set noincsearch

6

Re: Problem when seach forward ('/') finds match in quoted string

Thanks for the information, gt2847. It does indeed seem to be a ReSharper issue rather than a ViEmu issue. I hope they fix it soon. In the meantime, the workarounds should save my sanity.