Repository navigation
feat: 替换块按行相似度配对,删增行数不等也能逐行高亮 - #9
Merged
Merged
Conversation
- 删增行数不等时按公共前后缀相似度做单调对齐,低于 0.5 不配对 - 块行数超过 200 或字符总量超过 20 万退回整块显示,避免新的平方项 - 多出来的行按新侧顺序插在原位,不跑到块末尾
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
替换块的配对一直要求删增行数相等,行数一不等就整块红绿显示,行内高亮全部丢失。
实际案例:
2026-11-01-实验进展记录.md的表格新增了一列,同时多了一行| 3 |。删除 9 行、新增 10 行,行数不等,于是整块显示,每行只是在末尾多一列,却完全看不到行内差异。修复前后对比:
改动
| 3 |会显示在| 2 |与| 4 |之间。验证
pnpm typecheck、pnpm build通过。| 3 |单独标绿,位置正确。版本
0.4.4