chentoast / marks.nvim

A better user experience for viewing and interacting with Vim marks.
MIT License
848 stars 43 forks source link

Error executing BufEnter Autocommands #33

Closed euglevi closed 2 years ago

euglevi commented 2 years ago

First of all, thank you for the amazing plugin. It is a nice improvement over vim-signature.

From today, I noticed that if I have the builtin_marks option in my configuration I get the following error at the very start of Neovim:

Errore/i eseguendo BufEnter Autocommands for "*":                                                                                                                                                               
E5108: Error executing lua Vim:E474: Argomento non valido 

This is even if I use the configuration from the README example. I am sorry I do not know enough lua to debug this more.

EDIT: to be more precise, this seems to happen only with the marks "<" and ">". If I remove those ones, everything works fine again.

vsedov commented 2 years ago

I made a really quick fix on this :

local function setup_autocommands()
    vim.cmd([[augroup Marks_autocmds
    autocmd!
    autocmd BufRead, BufEnter * lua require("marks").refresh()
    autocmd BufRead, BufDelete * lua require("marks")._on_delete()
  augroup end]])
end

By adding BufRead ontop of BufEnter .

in the /marks/init.lua, but wasnt sure if this was the "correct" way of doing it >.<

chentoast commented 2 years ago

I just pushed a fix to master that should hopefully resolve this issue. Sorry for the inconvenience

euglevi commented 2 years ago

No big deal. Thank you very much!