Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: UNKNOWN PLUGIN error resulting from unloaded buffers (akinsho#928)
Problem: Currently when checking if a buffer is valid, we use the function nvim_buf_is_valid, however there is an edge case here described in the documentation where a buffer could have been unloaded, but still be "valid". If a buffer is unloaded and valid then referencing buflisted will result in a (UNKNOWN PLUGIN): Error executing lua: attempt to call a number value error. Solution: Instead of nvim_buf_is_valid we use nvim_buf_is_loaded which checks both whether a buffer is valid and loaded. This way we never attempt to reference buflisted of unloaded or invalid buffers. This PR should at least partially address akinsho#869. Applying the patch removes these errors for my config when invoking Neovim via nvim .. Because this error is so generic, it's possible that there could be more than one cause.
- Loading branch information