supermaven-inc / supermaven-nvim

The official Neovim plugin for Supermaven
https://supermaven.com/
MIT License
515 stars 25 forks source link

Problem with InsertLeave Autocommand #75

Open yngwi opened 1 month ago

yngwi commented 1 month ago

I use the Overseer plugin as a task runner and Supermaven causes problems when the Overseer task launch window is closed:

Screenshot 2024-07-17 101054

It refers to a completion_preview.lua file even though I have the inline completion disabled:

return {
    "supermaven-inc/supermaven-nvim",
    lazy = false,
    config = function()
        require("supermaven-nvim").setup({
            disable_inline_completion = true,
            disable_keymaps = true,
        })
    end,
}
redxtech commented 1 month ago

I'm getting the same issue when making a commit with Neogit.

It doesn't happen every time I make a commit, but more often than not, right after I press the keybind to make a commit & the window closes, it errors out a bunch.

Error message: image

Here's my config:

return {
    {
        'supermaven-inc/supermaven-nvim',
        opts = {
            keymaps = {
                accept_suggestion = '<M-i>',
            },
            color = {
                suggestion_color = '#585b70',
            },
            log_level = 'off',
        },
    },
}
rbuchberger commented 1 month ago

I'm seeing the same issue after creating a new note with neorg:

Error detected while processing InsertLeave Autocommands for "*":
Error executing lua callback: ...permaven-nvim/lua/supermaven-nvim/completion_preview.lua:98: Invalid buffer id: 3                                                                                                                         
stack traceback:                                                                                                                                                                                                                           
        [C]: in function 'nvim_buf_del_extmark'                                                                                                                                                                                            
        ...permaven-nvim/lua/supermaven-nvim/completion_preview.lua:98: in function 'dispose_inlay'                                                                                                                                        
        ...upermaven-nvim/lua/supermaven-nvim/document_listener.lua:39: in function <...upermaven-nvim/lua/supermaven-nvim/document_listener.lua:38>                                                                                       
Press ENTER or type command to continue   

The error repeats for every keystroke afterwards, requiring a restart of neovim. Here's a screen recording:

https://github.com/user-attachments/assets/dc8954b3-212a-4c78-a7d8-59e388682f65

I've tried disabling supermaven for the NeorgNewNote filetype but this has no effect. I'd like to; I don't need AI suggestions for how to name my notes. Honestly, y'all should probably disable supermaven for unrecognized filetypes by default.

Supermaven Config:

   {
     "supermaven-inc/supermaven-nvim",
     opts = {
       keymaps = { accept_word = "<A-space>" },
       ignore_filetypes = { markdown = true, gitcommit = true, norg = true },
       -- disable annoying startup message
       log_level = "off",
     },
   },

My complete neovim config

hboon commented 1 month ago

I have gotten this maybe 4 times since the plugin is public, but I have no idea how to reproduce it.

jonahfang commented 1 month ago

I have the same problem! Maybe:

image

hboon commented 2 weeks ago

I might have been mistaken. I have gotten this instead:

Error detected while processing BufWritePost Autocommands for "<buffer=1397>":
Error executing lua callback: ....10.0/share/nvim/runtime/lua/vim/lsp/_changetracking.lua:175: attempt to index local 'buf_state' (a nil value)
stack traceback:
        ....10.0/share/nvim/runtime/lua/vim/lsp/_changetracking.lua:175: in function '_get_and_set_name'
        .../Cellar/neovim/0.10.0/share/nvim/runtime/lua/vim/lsp.lua:465: in function 'text_document_did_save_handler'
        .../Cellar/neovim/0.10.0/share/nvim/runtime/lua/vim/lsp.lua:543: in function <.../Cellar/neovim/0.10.0/share/nvim/runtime/lua/vim/lsp.lua:542>
Error executing lua callback: ....10.0/share/nvim/runtime/lua/vim/lsp/_changetracking.lua:202: attempt to index local 'buf_state' (a nil value)
stack traceback:
        ....10.0/share/nvim/runtime/lua/vim/lsp/_changetracking.lua:202: in function 'reset_buf'
        .../Cellar/neovim/0.10.0/share/nvim/runtime/lua/vim/lsp.lua:559: in function <.../Cellar/neovim/0.10.0/share/nvim/runtime/lua/vim/lsp.lua:556>

One it happens, it can be reproduced when I navigate; until I quit Neovim. Leaving it here in case it's related and gives better clues of the symptons.