Skip to content

EditorSearchComponent

Defined in: src/obsidian/internals/Components/EditorSearchComponent.d.ts:9

Extends

Properties

app

app: App

Defined in: src/obsidian/internals/Components/AbstractSearchComponent.d.ts:11

Reference to the app

Inherited from

AbstractSearchComponent.app


containerEl

containerEl: HTMLElement

Defined in: src/obsidian/internals/Components/AbstractSearchComponent.d.ts:15

The container element in which the search component exists (i.e. Editor)

Inherited from

AbstractSearchComponent.containerEl


cursor

cursor: null | SearchCursor

Defined in: src/obsidian/internals/Components/EditorSearchComponent.d.ts:13

Search cursor for editor, handles search and replace functionality for editor


editor

editor: Editor

Defined in: src/obsidian/internals/Components/EditorSearchComponent.d.ts:17

Linked editor for search component


isActive

isActive: boolean

Defined in: src/obsidian/internals/Components/EditorSearchComponent.d.ts:21

Whether search component is currently rendering


isReplace

isReplace: boolean

Defined in: src/obsidian/internals/Components/EditorSearchComponent.d.ts:25

Whether search component is replacing text (includes ‘Replace’ input field)


replaceInputEl

replaceInputEl: HTMLInputElement

Defined in: src/obsidian/internals/Components/AbstractSearchComponent.d.ts:19

Container for the replacement input field

Inherited from

AbstractSearchComponent.replaceInputEl


scope

scope: Scope

Defined in: src/obsidian/internals/Components/AbstractSearchComponent.d.ts:23

Keyscope for search component

Inherited from

AbstractSearchComponent.scope


searchButtonContainerEl

searchButtonContainerEl: HTMLElement

Defined in: src/obsidian/internals/Components/AbstractSearchComponent.d.ts:27

Container for all the action buttons

Inherited from

AbstractSearchComponent.searchButtonContainerEl


searchContainerEl

searchContainerEl: HTMLElement

Defined in: src/obsidian/internals/Components/AbstractSearchComponent.d.ts:31

Container for the search component itself

Inherited from

AbstractSearchComponent.searchContainerEl


searchInputEl

searchInputEl: HTMLInputElement

Defined in: src/obsidian/internals/Components/AbstractSearchComponent.d.ts:35

Container for the search input field

Inherited from

AbstractSearchComponent.searchInputEl

Methods

clear()

clear(): void

Defined in: src/obsidian/internals/Components/EditorSearchComponent.d.ts:30

Remove all highlights from editor

Returns

void


findNext()

findNext(): void

Defined in: src/obsidian/internals/Components/EditorSearchComponent.d.ts:34

Find next search results from cursor and highlights it

Returns

void


findNextOrReplace()

findNextOrReplace(): void

Defined in: src/obsidian/internals/Components/EditorSearchComponent.d.ts:38

Replace cursor with replacement string if not null and moves to next search result

Returns

void


findPrevious()

findPrevious(): void

Defined in: src/obsidian/internals/Components/EditorSearchComponent.d.ts:42

Find previous search results from cursor and highlights it

Returns

void


getQuery()

getQuery(): string

Defined in: src/obsidian/internals/Components/AbstractSearchComponent.d.ts:40

Returns the current search query

Returns

string

Inherited from

AbstractSearchComponent.getQuery


goToNextInput()

goToNextInput(event): unknown

Defined in: src/obsidian/internals/Components/AbstractSearchComponent.d.ts:44

Switch to the next inputElement

Parameters

event

KeyboardEvent

Returns

unknown

Inherited from

AbstractSearchComponent.goToNextInput


hide()

hide(): void

Defined in: src/obsidian/internals/Components/EditorSearchComponent.d.ts:46

Hide/detaches the search component and removes cursor highlights

Returns

void


highlight()

highlight(ranges): void

Defined in: src/obsidian/internals/Components/EditorSearchComponent.d.ts:52

Add highlights for specified ranges

Parameters

ranges

EditorRange[]

Returns

void

onAltEnter()

onAltEnter(e?): void

Defined in: src/obsidian/internals/Components/EditorSearchComponent.d.ts:56

Highlights all matches if search element focused

Parameters

e?

KeyboardEvent

Returns

void


onEnter()

onEnter(event): unknown

Defined in: src/obsidian/internals/Components/AbstractSearchComponent.d.ts:48

Invokes findNextOrReplace

Parameters

event

KeyboardEvent

Returns

unknown

Inherited from

AbstractSearchComponent.onEnter


onModAltEnter()

onModAltEnter(e?): void

Defined in: src/obsidian/internals/Components/EditorSearchComponent.d.ts:60

Replace all search results with specified text if replace mode and replacement element is focused

Parameters

e?

KeyboardEvent

Returns

void


onSearchInput()

onSearchInput(): void

Defined in: src/obsidian/internals/Components/EditorSearchComponent.d.ts:64

Updates search cursor on new input query and highlights search results

Returns

void


onShiftEnter()

onShiftEnter(event): unknown

Defined in: src/obsidian/internals/Components/AbstractSearchComponent.d.ts:52

Invokes findPrevious

Parameters

event

KeyboardEvent

Returns

unknown

Inherited from

AbstractSearchComponent.onShiftEnter


replaceAll()

replaceAll(): void

Defined in: src/obsidian/internals/Components/EditorSearchComponent.d.ts:68

Replaces all search results with replacement query

Returns

void


replaceCurrentMatch()

replaceCurrentMatch(): void

Defined in: src/obsidian/internals/Components/EditorSearchComponent.d.ts:72

Replace current search result, if any, with replacement query

Returns

void


searchAll()

searchAll(): void

Defined in: src/obsidian/internals/Components/EditorSearchComponent.d.ts:76

Find all matches of search query and highlights them

Returns

void


show()

show(replace): void

Defined in: src/obsidian/internals/Components/EditorSearchComponent.d.ts:80

Reveal the search (and replace) component

Parameters

replace

boolean

Returns

void