🟢 [L1] Tab 在窄终端(<4列)扩展超出宽度 #27

Closed
opened 2026-06-03 13:54:28 +08:00 by dailz · 1 comment
Owner

文件: core/io/wrap.rs:23-31
分类: 渲染边界

问题: Tab 固定扩展为 4 空格,当 width < 4 时产生比请求宽度更宽的行。

建议修复: 按 tab stop 计算剩余空格数,超宽时跨行分割。

**文件**: `core/io/wrap.rs:23-31` **分类**: 渲染边界 **问题**: Tab 固定扩展为 4 空格,当 `width < 4` 时产生比请求宽度更宽的行。 **建议修复**: 按 tab stop 计算剩余空格数,超宽时跨行分割。
dailz added the severity/lowbugarea/io labels 2026-06-03 13:54:28 +08:00
dailz closed this issue 2026-06-11 13:37:24 +08:00
Author
Owner

已修复 — commit 5cb56da

修改文件: crates/core/src/io/wrap.rs — wrap_line_chars()

  1. 提取 TAB_WIDTH 常量(4),替代硬编码
  2. Tab stop 正确计算: TAB_WIDTH - (col % TAB_WIDTH)
  3. Tab 展开超过剩余宽度时跨行分割,不再溢出
  4. 新增 4 个回归测试,全量 246 测试通过
**已修复** — commit 5cb56da 修改文件: crates/core/src/io/wrap.rs — wrap_line_chars() 1. 提取 TAB_WIDTH 常量(4),替代硬编码 2. Tab stop 正确计算: TAB_WIDTH - (col % TAB_WIDTH) 3. Tab 展开超过剩余宽度时跨行分割,不再溢出 4. 新增 4 个回归测试,全量 246 测试通过
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dailz/logViewer#27