Looking for Feedback on Ctrl+F3 (Edit.FindNextSelected)


I’m investigating the MSDN Product Feedback Center issue where Find Next Selected should not use regular expressions or wildcards(http://lab.msdn.microsoft.com/ProductFeedback/viewFeedback.aspx?feedbackid=18ff6379-d9e2-4baa-9c61-3a99889c6ba1).

The intention of the command is to take the text that is currently selected and find the next occurance of that text.  Our current design has this tied to the options in the Quick Find/Replace dialog.  This means that it will respect the Look in scope, Match case, Match Whole Word, Search Hidden Text and the options to Use Regular Expressions/Wildcards.  The problem is that this command does not make sense to use with regular expressions or wildcards. 

We are considering making a change to this command such that it will always search the Current Document, with Match case, Searching Hidden Text but never match whole word, nor use Regular Expressions or Wildcards. 

Since this is a commonly used command, I’d love to get more feedback from users before making this change.  Please let us know what you think!

Thanks,
Sean Laberee


Bonus:  For those of you who want to try out the new behaviour, I’ve written the following macros to demonstrate what it would be like!


    Sub FindNextSelected()


        DTE.Find.MatchCase = True


        Dim sel As TextSelection = DTE.ActiveDocument.Selection


        DTE.Find.FindWhat = sel.Text


        DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument


        DTE.Find.MatchCase = True


        DTE.Find.MatchWholeWord = False


        DTE.Find.Backwards = False


        DTE.Find.MatchInHiddenText = True


        DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxLiteral


        DTE.Find.Action = vsFindAction.vsFindActionFind


        If (DTE.Find.Execute() = vsFindResult.vsFindResultNotFound) Then


            Throw New System.Exception(“vsFindResultNotFound”)


        End If


    End Sub


    Sub FindPreviousSelected()


        DTE.Find.MatchCase = True


        Dim sel As TextSelection = DTE.ActiveDocument.Selection


        DTE.Find.FindWhat = sel.Text


        DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument


        DTE.Find.MatchCase = True


        DTE.Find.MatchWholeWord = False


        DTE.Find.Backwards = True


        DTE.Find.MatchInHiddenText = True


        DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxLiteral


        DTE.Find.Action = vsFindAction.vsFindActionFind


        If (DTE.Find.Execute() = vsFindResult.vsFindResultNotFound) Then


            Throw New System.Exception(“vsFindResultNotFound”)


        End If


    End Sub


 


Comments (2)

  1. pleblond says:

    I fully agree with the proposed change. The current behavior is confusing.

    Thank you for giving us a chance to give

    our views.

  2. Xentrax says:

    I think that using RegExe/Wildcards can not be anyhow useful for "Find Selected", so this option should be ignored.

    On the other hand, I would inherit all other options from Find dialog, or there would not be any way to control Find Selected behaviour.

    It would be very intuitive for me.