Skip to content

EditorSearchComponent

Unofficial

Search component embedded in the editor for find-and-replace functionality.

Import:

import type { EditorSearchComponent } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface EditorSearchComponent extends AbstractSearchComponent

Extends: AbstractSearchComponent

Properties

PropertyTypeDescription
appAppReference to the app.
(Inherited from AbstractSearchComponent)
containerElHTMLElementThe container element in which the search component exists (i.e. obsidian#Editor).
(Inherited from AbstractSearchComponent)
cursornull | SearchCursorSearch cursor for editor, handles search and replace functionality for editor.
editorEditorLinked editor for search component.
isActivebooleanWhether search component is currently rendering.
isReplacebooleanWhether search component is replacing text (includes 'Replace' input field).
replaceInputElHTMLInputElementContainer for the replacement input field.
(Inherited from AbstractSearchComponent)
scopeScopeKeyscope for search component.
(Inherited from AbstractSearchComponent)
searchButtonContainerElHTMLElementContainer for all the action buttons.
(Inherited from AbstractSearchComponent)
searchContainerElHTMLElementContainer for the search component itself.
(Inherited from AbstractSearchComponent)
searchInputElHTMLInputElementContainer for the search input field.
(Inherited from AbstractSearchComponent)

Methods

MethodReturnsDescription
clear()voidRemove all highlights from editor.
findNext()voidFind next search results from cursor and highlights it.
findNextOrReplace()voidReplace cursor with replacement string if not null and moves to next search result.
findPrevious()voidFind previous search results from cursor and highlights it.
getQuery()stringReturns the current search query.
(Inherited from AbstractSearchComponent)
goToNextInput(event)unknownSwitch to the next inputElement.
(Inherited from AbstractSearchComponent)
hide()voidHide/detaches the search component and removes cursor highlights.
highlight(ranges)voidAdd highlights for specified ranges.
onAltEnter(e?)voidHighlights all matches if search element focused.
onEnter(event)unknownInvokes findNextOrReplace.
(Inherited from AbstractSearchComponent)
onModAltEnter(e?)voidReplace all search results with specified text if replace mode and replacement element is focused.
onSearchInput()voidUpdates search cursor on new input query and highlights search results.
onShiftEnter(event)unknownInvokes findPrevious.
(Inherited from AbstractSearchComponent)
replaceAll()voidReplaces all search results with replacement query.
replaceCurrentMatch()voidReplace current search result, if any, with replacement query.
searchAll()voidFind all matches of search query and highlights them.
show(replace)voidReveal the search (and replace) component.

Links to this page: