SearchQuery
data class SearchQuery(val search: String = "", val caseSensitive: Boolean = false, val literal: Boolean = false, val regexp: Boolean = false, val replace: String = "", val wholeWord: Boolean = false, val test: (from: DocPos, to: DocPos, state: EditorState) -> Boolean? = null)
Represents a search query with options for how to match.
Parameters
search
The search string.
caseSensitive
Whether matching is case-sensitive.
replace
The replacement string.
wholeWord
If true, only match whole words.
test
Optional filter callback. When set, only matches for which test(from, to, state) returns true are included.
Constructors
Functions
Link copied to clipboard
Expand replacement for a simple string match.
Expand replacement string, handling $1, $&, $$ substitutions for regex matches.
Link copied to clipboard
fun getCursor(state: EditorState, from: DocPos = DocPos.ZERO, to: DocPos = state.doc.endPos): Iterator<SearchMatch>
Get a cursor for this query over a given state.