Fixed
- Bundled
table/table3snippets missing trailing newline — the$0final tabstop was inline on the last table row. When a table was inserted at the end of a document, there was no line below it, preventing cursor movement past the table. Fixed by adding a standalone$0as a separate final body element, matching the pattern used by theFrontmattersnippet. (#118)- Plugin:
src/snippets/bundled/obsidian-markdown.json(Table 2x2,Table 3x3— moved$0from inline on last row to standalone final element)
- Plugin:
- User-defined snippets duplicate bundled snippets instead of overriding them — when a user defined a snippet with the same prefix as a bundled one (e.g.,
table), both appeared in the completion menu and picker instead of the user snippet replacing the bundled one. Root cause:addToPrefixIndex()inSnippetRegistryinserted user entries before bundled entries but never removed the bundled entry, and entry IDs were source-qualified (bundled:Table 2x2vsuser:My Table) so both coexisted in theentriesMap. Fixed with priority-based override logic (user > lua > bundled): when a higher-priority source registers a prefix colliding with a lower-priority entry, the lower-priority entry is removed from the prefix index and, if orphaned (no remaining prefixes), from the entries Map. (#118)- Plugin:
src/snippets/registry.ts(sourcePrioritystatic method;addToPrefixIndexrewritten with priority-based filtering, orphan cleanup, and priority-sorted insertion)
- Plugin:
Tests
- 10 unit tests in
test/unit/snippets/registry.test.ts(issue #118): basic load and prefix indexing, user overrides bundled, lua overrides bundled, user overrides lua, full priority chain (user > lua > bundled), same-priority coexistence, multi-prefix partial overlap (keeps non-overlapping prefix), multi-prefix full overlap (removes orphaned entry), no-collision coexistence, bundled table snippet trailing newline validation - 7 e2e tests in
test/specs/snippets/snippet-override.e2e.ts(issue #118):tablesnippet trailing newline via Tab,table3snippet trailing newline via:snippet, table at end of document produces content after last row, user override expands correct body,lookupByPrefixreturns only user entry,getAllexcludes shadowed bundled entry, non-overridden bundled snippet still works
Documentation
CHANGELOG.mdCONTRIBUTING.md: Addedregistry.tsto snippets codebase structure with priority-based override descriptiondocs/features/snippets.md: Expanded override behavior documentation with priority order and Lua snippet override semantics
Full Changelog: 0.105.1...0.106.0