Update highlighter logic, add release scripts, and bump version to 1.3.6.
Some checks failed
Release / Bump Homebrew formula (push) Has been cancelled
Release / Build Linux amd64 (push) Has been cancelled
Release / Build Linux arm64 (push) Has been cancelled
Release / Build macOS arm64 (.app) (push) Has been cancelled
Release / Create GitHub Release (push) Has been cancelled

- Refined cached state validation in `HighlighterEngine` to ensure row validity and buffer consistency.
- Added `make-release` and `make-app-release` scripts for streamlined release builds.
- Disabled AddressSanitizer (ASAN) by default.
- Version bump to 1.3.6.
This commit is contained in:
2025-12-03 16:20:04 -08:00
parent f6c4a5ab34
commit dc2cf4c0a6
4 changed files with 50 additions and 4 deletions

View File

@@ -75,9 +75,13 @@ HighlighterEngine::GetLine(const Buffer &buf, int row, std::uint64_t buf_version
int best = -1;
for (const auto &kv: state_cache_) {
int r = kv.first;
// Only use cached state if it's for the current version and row still exists
if (r <= row - 1 && kv.second.version == buf_version) {
if (r > best)
best = r;
// Validate that the cached row index is still valid in the buffer
if (r >= 0 && static_cast<std::size_t>(r) < buf.Rows().size()) {
if (r > best)
best = r;
}
}
}
if (best >= 0) {