← API reference

//editor/com.aardarch.aardink.ui/FindReplacePanel

FindReplacePanel

@Composablefun FindReplacePanel(state: FindReplaceState, onNext: () -> Unit, onPrev: () -> Unit, onReplace: () -> Unit, onReplaceAll: () -> Unit, onClose: () -> Unit, modifier: Modifier = Modifier)

Slide-down find/replace panel anchored to the top of the editor.

The panel mutates state directly. The host (typically CodeEditorLayout) is responsible for watching the state and re-running com.aardarch.aardink.core.FindEngine.findAll on changes.

It takes the keyboard focus when it opens and on every FindReplaceState.show: the find field, or the replace field when opened for replacing with something already to find. In its fields, Enter goes to the next match (Shift+Enter to the previous one, and Enter in the replace field replaces the current match), and Escape closes the panel.

Parameters

NameSummary
stateThe state holder backing this panel.
onNextUser pressed the “next match” arrow — host should scroll/select that match.
onPrevUser pressed the “previous match” arrow.
onReplaceReplace the current match with FindReplaceState.replacement.
onReplaceAllReplace every match in the document.
onCloseClose the panel (typically calls FindReplaceState.hide).