New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 终端设置增加在双击选中区域包含特殊符号选项 #273
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不错不错,非常实用的功能,而且实现起来需要了解的相关qtermwidget内容也挺多的。(我Review了一会,才搞懂这个选中区域规则是怎么实现的)
不过有个小Bug: 在我这里,刚启动的时候还是会加载默认的全特殊分隔符规则,需要在termwidget里初始化一下。
另外,我觉得做成选中部分允许包含的特殊符号似乎会更合理一些。有以下好处:
- 符合QTermWidget中的实现逻辑。因为它判定是否应该被选中的时候,会判断_wordCharacters中有没有。所以,实现上直接用自定义的值 setWordCharacters 就实现了,不需要从所有的特殊符号中去除分隔符。
- 当前deepin-terminal默认的选中区域分割符是比较多的。(除 :@-./_~ 以外的特殊符号都是分割符)所以,一般情况是我选中的内容被无情分割,如果是删除分隔符的花会比较眼花缭乱,但如果是添加选中区域可包含的特殊符号的话,就会相对容易且直观些。
我觉得可以讨论一下这样。Konsole就是这个实现逻辑的,你可以装下体验一下。
972e0ea
to
12c91ff
Compare
已完成,请复审 @ArchieMeng |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
再优化下就可以合了.主要还是确定文案,现在实现和最开始不一样了,需要修改.
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
不好意思,翻车了,我得看看. |
Description: 本次提交提供在终端设置选项里面,自定义双击选中区域包含特殊符号的功能。 Log: 终端设置增加在双击选中区域包含特殊符号选项
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Description: 当前终端版本特性仅用部分符号作为长字符串的分隔符号且无法调整,无法应对用户在使用双击复制选中文本时灵活的使用场景。本次提交提供在终端设置选项里面自定义双击选中时分隔符。
Log: 终端设置增加在双击选中区域包含特殊符号选项
效果如下: