MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / computeExMatches

Function computeExMatches

packages/app-core/src/components/Editor.tsx:1182–1193  ·  view source on GitHub ↗
(prefix: string)

Source from the content-addressed store, hash-verified

1180}
1181
1182function computeExMatches(prefix: string): ExCompletionMatch[] {
1183 const argMatches =
1184 completeCommandArgs(prefix, 'view', ['edit', 'split', 'preview']) ??
1185 completeCommandArgs(prefix, 'zen', ['toggle', 'on', 'off'])
1186 if (argMatches) return argMatches
1187 if (!prefix) {
1188 return registeredExNames.map((name) => ({ label: name, apply: name }))
1189 }
1190 return registeredExNames
1191 .filter((n) => n.startsWith(prefix))
1192 .map((name) => ({ label: name, apply: name }))
1193}
1194
1195/**
1196 * Global capture-phase Tab interceptor for the CodeMirror-Vim ex prompt.

Callers 1

installExTabCompletionFunction · 0.85

Calls 1

completeCommandArgsFunction · 0.85

Tested by

no test coverage detected