CanWrap as part of IEditorSearchOptions

SyntaxEditor for WPF Forum

Posted 8 years ago by Erwin Liong
Version: 15.1.0624
Platform: .NET 4.5
Environment: Windows 10 (64-bit)
Avatar

Hi Actipro,

I notice that IEditorSearchOptions does not have ability to control CanWrap options.This makes it harder to use IEditorViewSearcher.Search.

The closest way to control wrapping capability is to use

editor.ActiveView.CurrentSnapshot.FindNext(searchOptions,
selection.FirstOffset /*may need to tinker a little for search up/down */,
CanWrap);

 Is there better alternative?

Thanks in advance.

[Modified 8 years ago]

Comments (2)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Erwin,

I don't believe the VS editor ever had a UI option for can-wrap.  Every time you press Find Next, it will locate the next one or will wrap to search at the beginning if a result isn't found.  That's what we do with our EditorSearchView as well.  The search result set will tell you if a wrap occurred.


Actipro Software Support

Posted 8 years ago by Erwin Liong
Avatar

Thank you for the response.

It seems like EditorSearchView would not work in my favor. The call to FindNext highlights the next word found and set the wrapped flag to true. I may end up having to change my selection to my previous selection if the search wrapped.

 

I guess TextSnapshot's FindNext is my only way.

The latest build of this product (v24.1.2) was released 3 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.