v0.5.0
What's new
Bug fixes
- Python
'''triple-quote strings now close correctly across lines (was coloring the rest of the file as string) - Config parser no longer crashes on empty quoted tokens (
""or''in config/MAT_OPTS) - Makefile recipe lines now highlight correctly (lexer sees original tabs before expansion)
- Parallel renderer propagates OOM instead of silently truncating output
- Shebang detection now works on the interactive (streaming) path, not just the pager/parallel paths
Security and robustness
- SIGBUS handler for mmap'd files: a truncated file falls back gracefully instead of crashing
- Pipe input capped at 256 MiB to prevent unbounded heap growth
- Terminal state restored on SIGINT/SIGTERM/SIGQUIT during paging (no more stuck raw-mode terminals)
- O_CLOEXEC on all input file descriptors
- Realloc failures in the render pipeline now set an error flag instead of silently dropping data
Performance
- Language dispatch (mat_hl_open): O(log n) bsearch replaces 169-entry linear strcmp chain (-280 lines)
- Theme dispatch (mat_theme_set): O(log n) bsearch replaces 45-entry linear strcmp chain
- Cached fstat(stdout) across files in the fast path (eliminates N-1 redundant syscalls)
- Cached sysconf(_SC_PAGESIZE) (called once per process instead of per-file)
- AVX2 scanners fall back to SSE2 for 16-31 byte tails instead of scalar
- Tab expansion batched into single wbuf_append per tab
- Hrule emission batched into single sink call per rule
Testing
- 200 tests (was 133): 67 new tests across all modules
- Keyword/dispatch table sort-order validator catches mis-sorted bsearch tables
- All 178 language dispatch entries smoke-tested (open + lex)
- UTF-16 edge cases: odd byte count, unpaired surrogates, garbage after BOM
- CLI parser unit tests, mat_pipe_write tests, cooked boundary tests
- Pager keybinding coverage (j/k/space), SIGPIPE behavior, diff marker golden
- MAT_OPTS/BAT_OPTS environment variable precedence tests
- Parallel error propagation and 12-file ordering tests
Full Changelog: v0.4.0...v0.5.0