Repository navigation
Conversation
- core 加 QuoteStyle(Curly 弯引号,默认 / Corner 直角引号),只影响全角标点;左右交替、光标前是空白或左括号给左引号、数字后面保持半角的规则两套一样 - 自动配对跟着引号样式走(Corner 下 " 配「」,' 配『』) - ABI 1.15 末尾加 quote_style,旧外壳给的结构体短时保持默认 CURLY,行为不变 - fcitx5 插件加 QuoteStyle 选项和 WOWTYPE_QUOTE_STYLE 环境变量 - Linux 设置界面「默认全角/半角」下面加「引号样式」下拉框 - spec/config.json 登记这一项(先只写 fcitx5、settings 两端) - 测试:symbols 单元测试 1 个,key harness 4 个(Corner 双引号、单引号、半角不换、默认仍是弯引号)
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.
Closes #303
改了什么
全角标点下引号可以选弯引号还是直角引号,默认弯引号(行为和现在完全一样)。
只影响全角(
PunctuationStyle=Fullwidth)。两套样式共用的规则没有区别:左右交替(连按两次"得到「」)、光标前是空白或左括号时给左引号、数字后面该半角的符号仍然半角。各端改动
QuoteStyle枚举;quote()按样式取左右引号;新增punct_with_quotes、auto_pair_with、closing_punct_with,原来的函数改成调它们并传默认值,外部 API 不变WowtypeSessionConfig末尾加quote_style(1.15),旧外壳给的结构体短时保持默认CURLYQuoteStyle设置项、WOWTYPE_QUOTE_STYLE环境变量(corner/ 其他当弯引号)platforms写fcitx5、settings两端macOS 和 Windows 也走同一个 FFI 核心,补齐只需要在各自填配置的地方加一行(
settings.punct_style旁边)。但我在 Linux 上没法编译验证那两端,所以这次没动,platforms里也没写。要三端一起上我可以按同样方式补,不过需要你那边跑一下macos/test.sh和windows/test.sh确认。验证
cargo test -p wowtype-core --release --lib:361 通过(新增 1 个 Corner 用例)cargo test -p wowtype-core --release --test session_keys:119 通过scripts/test-config-contract.py:846 项通过wowtype-key-harness:新增 4 个 QuoteStyle 用例通过(Corner 双引号、Corner 单引号、半角时不换、默认仍是弯引号)harness 另外有 4 条失败(
GitHub大小写、用户词库三条例),用未修改的代码跑同样 4 条也失败,和这次改动无关——是测试环境的词库和文件状态问题。一个设计取舍
quote()里判断"光标前是不是左括号"的字符表现在去掉了「『。原因是 Corner 样式下「『成了引号自己上屏的字符,留在表里会让连着按第二个引号键又被判定成"前面跟的是左括号",一直给左引号。弯引号“”‘’本来就不在那张表里,所以默认行为没有变化(quotes_alternate_left_and_right原有用例照过)。