[1243] 打开 AI 侧边栏时自动填入文档选区内容 - #4437
Open
da-liii wants to merge 2 commits into
Open
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
- scheme 纯判定 chat-tab-should-prefill?:输入区为空且选区非空白时预填 - scheme 包装 chat-tab-prefill-from-selection!:捕获当前编辑器选区, chat 相关 buffer 不作为来源 - C++ 钩子:sync_chat_sidebar_mode 隐藏→显示转换时、focusInput 之前调用 Co-Authored-By: Claude <noreply@anthropic.com>
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.
What
文档中存在选区时,打开 AI 对话侧边栏(点击右上角按钮或
std j),若当前会话输入区为空,自动把选中内容填入输入区。How
chat-tab-buffer-empty?/chat-tab-empty-body?/chat-tab-set-input-body!sync_chat_sidebar_mode()的「隐藏→显示」转换时、focusInput()之前调一行call(此时 current editor 仍是文档编辑器,selection-tree能取到选区;同时覆盖按钮与快捷键两条打开路径)tmfs://chat前缀)不作为选区来源测试
xmake r 1243:15 correct, 0 failed(headless 与 GUI 模式均通过)🤖 Generated with Claude Code