feat: v0.8.0 —— 修复围栏空行断状态,代码块改为真正的语法高亮

修复
- highlightBlock 遇到空行直接 return,把围栏状态重置了:代码块中间只要有一条
  空行,后面的行就不再按代码处理(这正是 #include 之后代码变回普通文本的原因)
- 空行现在会延续围栏状态;闭合围栏行也不再被误判成新的开围栏

语法高亮
- 新增 CodeHighlight:自己写的轻量 tokenizer,不依赖第三方库
- 支持 C / C++ / Python / JavaScript / TypeScript / Java / Rust / Go /
  JSON / Bash / SQL / YAML,按 info string 识别
- 关键字、类型、字符串、数字、行/块注释(支持跨行)、C/C++ 预处理指令分色
- 围栏行在源码模式下改成灰色标记色,不再是代码红
- 编辑模式与源代码模式共用同一套 token 着色

其它
- 主题新增 5 个代码 token 颜色(浅色 / 深色各一套)
- 版本 0.8.0,README 补充支持语言
This commit is contained in:
2026-10-22 18:14:34 +08:00
parent a136ed1eaa
commit 233d732604
11 changed files with 505 additions and 28 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 114 KiB