FindState

class FindState(val textState: TextEditorState, scope: CoroutineScope)(source)

State management for the Find feature.

Parameters

textState

The TextEditorState to search within

scope

CoroutineScope for handling text change reactions

Constructors

Link copied to clipboard
constructor(textState: TextEditorState, scope: CoroutineScope)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Clear the search - remove all highlights and reset state.

Link copied to clipboard
fun dispose()

Cancel any ongoing operations. Call this when done with FindState.

Link copied to clipboard
fun findNext()

Navigate to the next match.

Link copied to clipboard

Navigate to the previous match.

Link copied to clipboard
fun goToMatch(index: Int)

Jump to a specific match by index.

Link copied to clipboard
fun replaceAll(replaceText: String): Int

Replace all matches with the given text.

Link copied to clipboard
fun replaceCurrent(replaceText: String): Boolean

Replace the current match with the given text and move to the next match.

Link copied to clipboard
fun search(newQuery: String)

Execute a search with the given query. Updates highlights and jumps to the nearest match.

Link copied to clipboard

Toggle case sensitivity and re-run search if there's an active query.