Repository navigation
fix(selection): 拒绝用截断选区覆盖原文 - #1151
Merged
Merged
Conversation
超过 4000 字的选区会被收成头尾摘要。校验又按同样的方式截断后再比较,因此摘要能通过检查,整段粘贴会删掉中间原文。选区润色和选区语音现在拒绝这种摘要,粘贴前也不再把截断文本当成原文。 Co-authored-by: lubaiqing9 <lubaiqing9@gmail.com>
Collaborator
|
我来认领这个 PR 的代码审查,避免重复工作。接下来会基于最新 beta 与当前 PR head,检查需求符合度、实现正确性和回归风险。 |
H-Chris233
marked this pull request as ready for review
October 7, 2026 08:47
H-Chris233
approved these changes
Oct 7, 2026
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.
摘要
Fixes #无对应 issue。
选区超过 4000 字时,捕获结果只保留头尾摘要,但粘贴仍覆盖整段真实选区,中间原文会被删掉。
修复 / 新增 / 改进
omits_middle的捕获。兼容
测试计划
selection.rs相同的截断函数做独立断言(超长选区会标记并与完整原文不相等;恰好 4000 字保留全文;普通文本里的截断标记不会被误判)。selection::tests已补上同样用例。cargo test --lib selection::tests::。