devchat icon indicating copy to clipboard operation
devchat copied to clipboard

优化代码块插入功能:支持选中部分代码插入

Open yangbobo2021 opened this issue 7 months ago • 0 comments

Is your feature request related to a problem? Please describe. 当前在AI问答结果中使用代码块插入功能时,只能插入整个代码块,无法插入用户选中的部分代码片段,这降低了使用的灵活性。

Describe the solution you'd like 希望改进代码块插入功能:

  1. 当用户没有选中代码时,保持现有行为,插入整个代码块
  2. 当用户选中了代码块中的部分内容时,点击插入按钮只插入选中的部分

Describe alternatives you've considered

  1. 在代码块旁增加两个按钮,分别用于插入全部和插入选中内容
  2. 右键菜单增加选中插入选项

Additional context 这个改进可以提升用户在复用代码片段时的效率,避免插入后还需要手动删除不需要的部分。

yangbobo2021 avatar Jun 09 '25 08:06 yangbobo2021