CodeMirror 6 Plugin - Latest Development Preview
The latest development state of the CodeMirror 6 plugin is available for testing at:
https://deploy-preview-9556--tiddlywiki-previews.netlify.app/
Recent Changes & Fixes
Configurable Enter Key Indentation
A new configuration option has been added for Enter key behavior:
Config tiddler: $:/config/codemirror-6/lang-tiddlywiki/enterIndent
Options:
-
smart (default): Full smart indentation - automatically indents inside widgets, HTML tags, conditionals (<%if%>, <%else%>), and pragma definitions
-
indent: Simply matches the previous line’s indentation
-
none: Inserts a plain newline with no indentation
Note: Lists always continue on Enter regardless of this setting. The configuration only affects behavior outside of lists.
Simplified Pragma Completions
Pragma completions (\define, \procedure, \function, \widget, etc.) now only insert the keyword name instead of full templates with \end. Full templates with parameter placeholders are now handled by snippets, giving you more control over the inserted content.
Tag-Based Language Override System
You can now override the editor language for a tiddler using tags. Configure which tag activates which language mode via config tiddlers like $:/config/codemirror-6/lang-css/tags. When multiple tags on a tiddler point to different languages, the first matching tag wins.
Tooltips/Popups Configuration
Tooltips and completion popups now properly append to document.body, preventing clipping issues in iframes and other constrained containers.
Bug Fixes
-
Fixed CSS completions not working in standalone text/css tiddlers (completions now work both in $$.css code blocks and in CSS-type tiddlers)
-
Extended completion support to other languages (HTML, Python, Go) in standalone tiddlers
-
Fixed server-side build compatibility for the edit-text plugin
-
Code formatting improvements across plugin files
Please test and report any issues! Your feedback helps improve the plugin.