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

feat: add pattern support #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

cworld1
Copy link

@cworld1 cworld1 commented Apr 14, 2024

It should give a config to custom pattern, not just give it to plugin itself to find it. It is the difficulty for me to use AIMSwitcher (which support windows input method mode), which need a specific pattern --imm.

@keaising
Copy link
Owner

能不能改成这样:

  • C.default_command 是一个 table:
local C = {
    -- im-select binary's name, or the binary's full path
    default_command = { "im-select.exe" },
  • config.default_command 则两种都支持
    • 既可以写 string(兼容现有的写法 default_command = 'im-select.exe',
    • 也可以写 table,比如 default_command = { "AIMSwitcher.exe," "--im" },或者 default_command = { "im-select.exe" }

然后在函数 set_opts 里做一下判断,如果用户给 default_command 传入的是 string,就拼成一个 table 设置到 default_command,如果用户设置的是 table,则直接使用用户的 table,这样的好处是兼容以前的配置,且不用加新的参数

当然,其他用到 default comamnd 的地方也需要一并修改

@cworld1
Copy link
Author

cworld1 commented May 29, 2024

我觉得可以试试。可能需要一些时间,最近可较忙

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.

None yet

2 participants