Skip to content
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

支持命令行切换中英文模式 #797

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

PangPangPangPangPang
Copy link

/Library/Input\ Methods/Squirrel.app/Contents/MacOS/Squirrel --ascii_mode 切换到 ascii 模式
/Library/Input\ Methods/Squirrel.app/Contents/MacOS/Squirrel --ascii_mode_prev 切换到之前的模式

通过这个 feature 可以做到在 neovim 中更精确的控制输入法模式

}

-(void)changeToAsciiPrev {
if (_prev) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_prev does not sync with the current status from the rime session.

Between last call to changeToAscii and this one, the ascii_mode value could have changed by the user.

@@ -61,6 +61,21 @@ int main(int argc, char *argv[]) {
return 0;
}

if (argc > 1 && !strcmp("--ascii_mode", argv[1])) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a one-way setting ascii_mode to true, I think we need both ways, by supplying a value:

--ascii_mode=true|fales or numeric value --ascii_mode=0|1, to be coherent with the swtich option's reset values.

return 0;
}

if (argc > 1 && !strcmp("--ascii_mode_prev", argv[1])) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the caller keep track of which state should be put back in?

@edte
Copy link

edte commented Jun 28, 2024

大佬这个merge还有下文吗,非常需要这个功能。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants