Skip to content

EditableFileView

Official

Editable file view

Import:

import { EditableFileView } from 'obsidian';

Signature:

export class EditableFileView extends FileView

Extends: FileView

Constructor

new EditableFileView(leaf: WorkspaceLeaf)

Constructor.

To extract the constructor type, use ExtractConstructor<EditableFileView>.

Properties

PropertyTypeDescription
allowNoFilebooleanWhether the view may be run without an attached file..
(Inherited from FileView)
filenull | TFileThe file that is currently being viewed.
(Inherited from FileView)
fileBeingRenamednull | TFileThe file that is currently being renamed.
navigationbooleanWhether the file view can be navigated.
(Inherited from FileView)

Methods

MethodReturnsDescription
canAcceptExtension(extension)booleanWhether the file view can accept an extension.
(Inherited from FileView)
getDisplayText()stringGet the display text for the file view.
(Inherited from FileView)
getState()Record<string, unknown>Get the state of the file view.
(Inherited from FileView)
getSyncViewState()unknownGet view state for sync plugin.
(Inherited from FileView)
loadFile(file)Promise<unknown>Loads the file with the onLoadFile function.
(Inherited from FileView)
onDelete(file)Promise<void>Updates the view if it contains the deleted file.
(Inherited from FileView)
onload()voidCalled when the file view is loaded.
(Inherited from FileView)
onLoadFile(file)Promise<void>Called when the file is loaded.
(Inherited from FileView)
onRename(file)Promise<void>Called when the file is renamed.
(Inherited from FileView)
onTitleBlur()Promise<void>Is called when the titleEl looses focus.

Event type: 'blur'.
onTitleChange(titleEl)voidIs called when the titleEl is changed.

Event type: 'input'.
onTitleFocus()voidIs called when the titleEl gains focus.

Event type: 'focus'.
onTitleKeydown(event)voidIs called when the titleEl is focused and a keydown is triggered.

Event type: 'keydown'.
onTitlePaste(titleEl, event)voidIs called when the titleEl is focused and a paste event is triggered.

Event type: 'paste'.
onUnloadFile(file)Promise<void>Called when the file is unloaded.
(Inherited from FileView)
receiveSyncState(view)voidReceives sync state from another file view, opening the other view's file if it differs.
(Inherited from FileView)
renderBreadcrumbs()voidRender the breadcrumb navigation for this file view.
(Inherited from FileView)
saveTitle(titleEl)Promise<void>Updates the file to match the updated title.
setState(state, result)Promise<void>Set the state of the file view.
(Inherited from FileView)
syncState(e)Promise<unknown>Synchronize the view state with the sync plugin.
(Inherited from FileView)

Links to this page: