Skip to content

Transaction

Unofficial

Import:

import type { Transaction } from '@codemirror/state';

Signature:

export interface Transaction

Methods

MethodReturnsDescription
annotation(type)T | undefinedGet the value of the given annotation type, if any.
isUserEvent($event)booleanReturns true if the transaction has a user event annotation that is equal to or more specific than event.
isUserEvent($event)booleanCheck whether the user dedents a line or lines, usually by typing Shift + Tab keys. Included in 'delete' event.
isUserEvent($event)booleanCheck whether the user deletes a line or lines, usually by typing Ctrl + Shift + K keys. Included in 'delete' event.
isUserEvent($event)booleanCheck whether the user inputs a content through Obsidian editor suggest autocompletion. Currently, this event is only dispatched when autocompleting a wikilink or inserting Markdown link through command. Included in 'input' event.
isUserEvent($event)booleanCheck whether the user creates a copy of the selected lines. Usually dispatched when performing copyLineUp or copyLineDown commands. Included in 'input' event.
isUserEvent($event)booleanCheck whether the user indents a line or lines, usually by typing Tab key. Included in 'input' event.
isUserEvent($event)booleanCheck whether the user replaces all search matches. Usually dispatched when performing replaceAll command. Included in 'input' and 'input.replace' events.
isUserEvent($event)booleanCheck whether the user replaces search match(es). Usually dispatched when performing replaceNext or replaceAll commands. Included in 'input' event.
isUserEvent($event)booleanCheck whether the user starts a composition input sequence. Included in 'input', 'input.type', and 'input.type.compose' events.
isUserEvent($event)booleanCheck whether the user flips the characters before and after the cursor(s). Usually dispatched when performing transposeChars command. Included in 'move' event.
isUserEvent($event)booleanCheck whether the user moves the selected line up or down. Usually dispatched when performing moveLineUp or moveLineDown commands. Included in 'move' event.
isUserEvent($event)booleanCheck whether the transaction is triggered by a scroll action.
isUserEvent($event)booleanCheck whether the user redoes a selection change. Usually dispatched when performing redoSelection command. Included in 'select' event.
isUserEvent($event)booleanCheck whether the user selects all search matches. Usually dispatched when performing selectMatches and selectSelectionMatches commands. Included in 'select' event.
isUserEvent($event)booleanCheck whether the user selects search match(es). Usually dispatched when performing findNext and findPrevious commands. Included in 'select' and 'select.search' events.
isUserEvent($event)booleanCheck whether the user undoes a selection change. Usually dispatched when performing undoSelection command. Included in 'select' event.
isUserEvent($event)booleanCheck whether a content change is not made explicitly by the user. It happens in some circumstances, for instance: - Change made externally, e.g. by other text editor programs. - Change made by another editor view that holds the same note. - Change made by the vault, file manager, and file system API.

Links to this page: