MCPcopy Create free account
hub / github.com/chhoumann/quickadd / getMarkdownEditorViewForFile

Function getMarkdownEditorViewForFile

src/utils/editorInsertion.ts:17–24  ·  view source on GitHub ↗
(
	app: App,
	file: TFile,
)

Source from the content-addressed store, hash-verified

15 * meaning its editor can be used to insert at the cursor.
16 */
17export function getMarkdownEditorViewForFile(
18 app: App,
19 file: TFile,
20): MarkdownView | null {
21 const view = app.workspace.getActiveViewOfType(MarkdownView);
22 if (view?.file?.path === file.path) return view;
23 return null;
24}
25
26/**
27 * @returns true if the text was inserted, false if there was no active Markdown

Callers 2

pickInsertModeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected