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

Function commandIdToExName

packages/app-core/src/components/Editor.tsx:956–962  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

954])
955
956function commandIdToExName(id: string): string {
957 // CM-Vim's ex parser only reads word characters (`\w+` = `[A-Za-z0-9_]`)
958 // for the command name. Any non-word char — dot, dash, etc. — ends the
959 // name early. Collapse them all to underscores so `note.copy-wikilink`
960 // → `note_copy_wikilink` is recognized as a single token.
961 return id.replace(/[^A-Za-z0-9]+/g, '_')
962}
963
964/** Names of every ex command we register. Captured during init so the
965 * tab-completion handler can match against the full set without re-

Callers 1

registerCommandPaletteExFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected