Closed madjxatw closed 12 months ago
Wrong config, have a try with this one:
{
"keaising/im-select.nvim",
config = function()
require("im_select").setup({
set_default_events = { "VimEnter", "InsertLeave", "CmdlineLeave" },
})
end,
},
There is no more terminal spawning occurring, but input method (keyboard) switch still does not work.
{
"keaising/im-select.nvim",
opts = {
set_default_events = { "VimEnter", "InsertLeave", "CmdlineLeave" },
}
config = function(_, opts)
require("im_select").setup(opts)
end,
},
Please follow my instructions.
I did it but i didn't work. BTW, both of my config are correct, they work well on Linux.
Please follow this instruction, without modified by yourself: https://github.com/keaising/im-select.nvim/issues/16#issuecomment-1704005154
Please follow this instruction, without modified by yourself: #16 (comment)
I said I did the same way but it did not work.
Can not reproduce
There is another user meet similar issue on Windows, but I don't use Windows heavily and I can not reproduce your issue, so I add some doc https://github.com/keaising/im-select.nvim/pull/18 which metioned your issue in README.
If someone can fix your issues on Windows in the future, I will merge their PR.
Maybe you could try changing this code in im_select.lua
:
if C.async_switch_im then
vim.fn.jobstart(table.concat(command, " "), { detach = true })
else
local jobid = vim.fn.jobstart(table.concat(command, " "), { detach = false })
vim.fn.jobwait({ jobid }, 200)
end
to:
if C.async_switch_im then
-- vim.fn.jobstart(table.concat(command, " "), { detach = true })
vim.fn.jobstart(command, { detach = true })
else
-- local jobid = vim.fn.jobstart(table.concat(command, " "), { detach = false })
local jobid = vim.fn.jobstart(command, { detach = false })
vim.fn.jobwait({ jobid }, 200)
end
After I did this, im-select.nvim works on windows 11.
Oh sorry, I found out that the reason I had to change the code to make it work is:
vim.opt.shell = "pwsh -NoLogo"
If comment out the above, im-select.nvim
could work without changing the code, but a pop-up window will appear every time I press esc
.
@madjxatw Could you please have a try with https://github.com/keaising/im-select.nvim/pull/22 ?
I want to know whether this PR can solve your problem or not.
If you have any question, please comment in https://github.com/keaising/im-select.nvim/pull/22
I am using Windows 11 and managing plugins via lazy.nvim. The
im-select
binary is placed along with thenvim
binary in the same directory, it can be accessed in Command Prompt and Powershell. However, with the default config, nvim keeps spawning terminal windows once launched.I have to remove the
"FocusGained"
from the default events to prevent nvim from spawning terminal windows:Now a terminal windows flashes around 2~3 times on each press of
Esc
, but input method does not get switched.BTW, I could mange to switch to the US keyboard by directly executing
:!im-select 1033
.