keaising / im-select.nvim

Switch Input Method automatically depends on Neovim's edit mode
MIT License
170 stars 25 forks source link

seems not work in search mode #6

Closed ShiChenCong closed 1 year ago

ShiChenCong commented 1 year ago

titie is summary, in normal mode, works like a charm, not work in search mode

ShiChenCong commented 1 year ago
  vim.api.nvim_create_autocmd({ "InsertLeave", "VimEnter", "CmdlineLeave" }, {
      callback = function()
        local current_select = all_trim(vim.fn.system({ C.default_command }))
        vim.api.nvim_set_var("im_select_current_im_select", current_select)

        if current_select ~= C.default_method_selected then
          vim.fn.system({ C.default_command, C.default_method_selected })
        end
      end,
  })

seems like need to add CmdlineLeave

keaising commented 1 year ago

Thank you, this is a case I ignored past.

I'll take a look this weekend.

keaising commented 1 year ago

@ShiChenCong I have updated code command mode, you can find it in latest commit in master branch or this link

Thank you for your issue and sample code.