Skip to main content

MarkdownView

Extends TextFileView

Implements MarkdownFileInfo

Constructor​

constructor(leaf: WorkspaceLeaf);

Properties​

editor​

editor: Editor

previewMode​

previewMode: MarkdownPreviewView

currentMode​

currentMode: MarkdownSubView

hoverPopover​

hoverPopover: HoverPopover

Methods​

getViewType​

getViewType(): string;

getMode​

getMode(): MarkdownViewModeType;

getViewData​

getViewData(): string;

Gets the data from the editor. This will be called to save the editor contents to the file.

clear​

clear(): void;

Clear the editor. This is usually called when we're about to open a completely different file, so it's best to clear any editor states like undo-redo history, and any caches/indexes associated with the previous file contents.

setViewData​

setViewData(data: string, clear: boolean): void;

Set the data to the editor. This is used to load the file contents.

If clear is set, then it means we're opening a completely different file. In that case, you should call clear(), or implement a slightly more efficient clearing mechanism given the new data to be set.

showSearch​

showSearch(replace?: boolean): void;