Pragtical v3.11.0 Release
Pragtical v3.11.0 is out with code folding support, generated settings views, faster rendering paths for large files, and a set of MarkdownView and tokenizer improvements that make long documents smoother to work with.
Code Folding
This release adds code folding support to the editor. Fold markers are rendered in the gutter, folded regions integrate with DocView's visual line mapping, and the editor now keeps search, go-to-line, line wrapping, indent guides, and smooth caret behavior aligned with hidden folded lines.
Fold state is also persisted per project, so documents can reopen with their previous folded regions restored.
Config
config.plugins.codefold = {
-- Whether code folding is enabled.
enabled = true,
-- If true, newly opened documents have all fold regions initially collapsed.
start_folded = false,
-- If true, folded regions hide the folded end-line tail.
hide_tail_on_fold = true,
-- If true, all fold markers are always visible.
always_show_fold_markers = false,
-- Width in pixels reserved for fold toggle indicators in the gutter.
toggle_width = common.round(24 * SCALE)
}
Commands
keymap.add {
["alt+shift+left"] = "code-folding:toggle",
["alt+shift+right"] = "code-folding:toggle",
["alt+shift+up"] = "code-folding:fold-all",
["alt+shift+down"] = "code-folding:unfold-all"
}
Settings Views
Generated settings views landed in this release, giving plugins a structured way to expose configurable options without hand-building every settings screen. Follow-up fixes also improved how nested plugin subconfig values are merged back into the global configuration.
Preview
Rendering And Wrapping
DocView received better long-line rendering behavior, and the native tokenizer now matches long lines more efficiently. The line wrapping plugin was synced with DocView's visual line helpers, improving wrapped-line drawing, navigation, selection, and integration with plugins that need to reason about visible rows.
Native Tokenizer Local Benchmarks:
codemirror.min.js, about 1 MB with very long minified lines:
Before: about 1314.3 s
After: about 43.6 s
Speedup: about 30.1x
sqlite3.c, about 8 MB and 235k lines:
Before: about 6.3 s
After: about 3.0 s
Speedup: about 2.1x
MarkdownView
As suggested by Vinfall MarkdownView now renders frontmatter blocks in a legible format:
Before
After
It can also parse large Markdown views asynchronously. This keeps previews more responsive while large documents are parsed and laid out.
Markdown code block highlighting also recognizes more popular language aliases.
Networking And Runtime
While working with the assistant plugin found some issue where our code expected all sent data to be written at once. Now TCP writes return byte counts, making network scripting behavior more reliable.
The editor also reduces unfocused wake delay when focus is restored, which helps it react more promptly after returning to the application.
Fixes And Build Work
Several Windows build issues were addressed, including clang-cl compatibility,
MSVC fallback handling, and a parallel build collision involving generated
pragtical.lib and .exp files. GitHub workflow dependencies were also updated.
Thanks to AmerM137 who spearheaded many of the fixes and improvements for this release.
Downloads on GitHub.
Changes Log
New Features
Enhancements
-
Render MarkdownView frontmatter legibly (#502)
-
Improve DocView long-line rendering (#507)
-
Optimize native tokenizer matching for long lines (#508)
-
Sync line wrapping with DocView rendering (#509)
-
Add codeblock patterns for popular Markdown languages (#511)
-
Return byte counts from TCP writes (#512)
-
Parse large Markdown views asynchronously (#513)
Fixes
-
Fix clang-cl build errors on Windows (#491)
-
Avoid pragtical.lib/.exp collision in MSVC parallel builds (#493)
-
Correct native tokenizer matching semantics (#496)
-
Add explicit type fields to language_python pair patterns (#498) (#503)
-
Fix settings subconfig merge (64609770)
-
Reduce unfocused wake delay when restoring focus (#504)
