EditorSearchComponent
Unofficial
Search component embedded in the editor for find-and-replace functionality.
Import:
import type { EditorSearchComponent } from '@obsidian-typings/obsidian-public-latest';Signature:
export interface EditorSearchComponent extends AbstractSearchComponentExtends: AbstractSearchComponent
Properties
| Property | Type | Description | |
|---|---|---|---|
| app | App | Reference to the app. (Inherited from AbstractSearchComponent) | |
| containerEl | HTMLElement | The container element in which the search component exists (i.e. obsidian#Editor).(Inherited from AbstractSearchComponent) | |
| cursor | null | SearchCursor | Search cursor for editor, handles search and replace functionality for editor. | |
| editor | Editor | Linked editor for search component. | |
| isActive | boolean | Whether search component is currently rendering. | |
| isReplace | boolean | Whether search component is replacing text (includes 'Replace' input field). | |
| replaceInputEl | HTMLInputElement | Container for the replacement input field. (Inherited from AbstractSearchComponent) | |
| scope | Scope | Keyscope for search component. (Inherited from AbstractSearchComponent) | |
| searchButtonContainerEl | HTMLElement | Container for all the action buttons. (Inherited from AbstractSearchComponent) | |
| searchContainerEl | HTMLElement | Container for the search component itself. (Inherited from AbstractSearchComponent) | |
| searchInputEl | HTMLInputElement | Container for the search input field. (Inherited from AbstractSearchComponent) |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| clear() | void | Remove all highlights from editor. | |
| findNext() | void | Find next search results from cursor and highlights it. | |
| findNextOrReplace() | void | Replace cursor with replacement string if not null and moves to next search result. | |
| findPrevious() | void | Find previous search results from cursor and highlights it. | |
| getQuery() | string | Returns the current search query. (Inherited from AbstractSearchComponent) | |
| goToNextInput(event) | unknown | Switch to the next inputElement. (Inherited from AbstractSearchComponent) | |
| hide() | void | Hide/detaches the search component and removes cursor highlights. | |
| highlight(ranges) | void | Add highlights for specified ranges. | |
| onAltEnter(e?) | void | Highlights all matches if search element focused. | |
| onEnter(event) | unknown | Invokes findNextOrReplace. (Inherited from AbstractSearchComponent) | |
| onModAltEnter(e?) | void | Replace all search results with specified text if replace mode and replacement element is focused. | |
| onSearchInput() | void | Updates search cursor on new input query and highlights search results. | |
| onShiftEnter(event) | unknown | Invokes findPrevious. (Inherited from AbstractSearchComponent) | |
| replaceAll() | void | Replaces all search results with replacement query. | |
| replaceCurrentMatch() | void | Replace current search result, if any, with replacement query. | |
| searchAll() | void | Find all matches of search query and highlights them. | |
| show(replace) | void | Reveal the search (and replace) component. |
Links to this page: