codeium.vim icon indicating copy to clipboard operation
codeium.vim copied to clipboard

Calling GetStatusString causes new files to opened in INSERT mode instead of NORMAL

Open V4G4X opened this issue 1 year ago • 3 comments

Normally when we open a file or function or something, like by telescope or LSP, it opens in NORMAL and after that we go into INSERT mode.

In my nvim config, I am running the following command and printing its output in my status bar.

    -- Function that returns current Codeium status
    local function get_codeium()
        return "{...}:" .. vim.api.nvim_call_function("codeium#GetStatusString", {})
    end

For some reason, when I call this function call for my lualine, it always opens new files in INSERT mode directly.

How do I fix this?

V4G4X avatar Apr 16 '24 15:04 V4G4X

It seems like a bug on Neovim v0.9.5, and I've tried it and the issue was fixed in Neovim v0.10 nightly. https://github.com/nvim-telescope/telescope.nvim/issues/2995

Nebell avatar Apr 24 '24 11:04 Nebell

For some reason, when I call this function call for my lualine, it always opens new files in INSERT mode directly.

i also use this function in my lualine, telescope messes this up for me:

          {
            'vim.fn["codeium#GetStatusString"]()',
            fmt = function(str)
              if str == " ON" then
                return " "
              elseif str == " OFF" then
                return " "
              elseif str == " * " then
                return " "
              else
                return "󰧑 " .. str
              end
            end,
          },

daUnknownCoder avatar Apr 24 '24 12:04 daUnknownCoder

It seems like a bug on Neovim v0.9.5, and I've tried it and the issue was fixed in Neovim v0.10 nightly. nvim-telescope/telescope.nvim#2995

This also affect vim as well. The neovim fix was downpatched to vim though. https://github.com/neovim/neovim/issues/27038

jamestrew avatar Apr 25 '24 03:04 jamestrew