Closed fnune closed 4 months ago
I'm closing this because:
I don't understand what's going on, but this is not a great issue anyway.
-- NOTE: See the end of this file if you are reporting an issue, etc. Ignore all the "scary" functions up top, those are -- used for setup and other operations. local M = {} local base_root_path = vim.fn.fnamemodify(debug.getinfo(1, "S").source:sub(2), ":p:h") .. "/.min" function M.root(path) return base_root_path .. "/" .. (path or "") end function M.load_plugin(plugin_name, plugin_url) local package_root = M.root("plugins/") local install_destination = package_root .. plugin_name vim.opt.runtimepath:append(install_destination) if not vim.loop.fs_stat(package_root) then vim.fn.mkdir(package_root, "p") end if not vim.loop.fs_stat(install_destination) then print(string.format("> Downloading plugin '%s' to '%s'", plugin_name, install_destination)) vim.fn.system({ "git", "clone", "--depth=1", plugin_url, install_destination, }) if vim.v.shell_error > 0 then error( string.format("> Failed to clone plugin: '%s' in '%s'!", plugin_name, install_destination), vim.log.levels.ERROR ) end end end ---@alias PluginName string The plugin name, will be used as part of the git clone destination ---@alias PluginUrl string The git url at which a plugin is located, can be a path. See https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols for details ---@alias MinPlugins table---Do the initial setup. Downloads plugins, ensures the minimal init does not pollute the filesystem by keeping ---everything self contained to the CWD of the minimal init file. Run prior to running tests, reproducing issues, etc. ---@param plugins? table function M.setup(plugins) vim.opt.packpath = {} -- Empty the package path so we use only the plugins specified vim.opt.runtimepath:append(M.root(".min")) -- Ensure the runtime detects the root min dir -- Install required plugins if plugins ~= nil then for plugin_name, plugin_url in pairs(plugins) do M.load_plugin(plugin_name, plugin_url) end end vim.env.XDG_CONFIG_HOME = M.root("xdg/config") vim.env.XDG_DATA_HOME = M.root("xdg/data") vim.env.XDG_STATE_HOME = M.root("xdg/state") vim.env.XDG_CACHE_HOME = M.root("xdg/cache") -- NOTE: Cleanup the xdg cache on exit so new runs of the minimal init doesn't share any previous state, e.g. shada vim.api.nvim_create_autocmd("VimLeave", { callback = function() vim.fn.system({ "rm", "-r", "-f", M.root("xdg"), }) end, }) end -- NOTE: If you have additional plugins you need to install to reproduce your issue, include them in the plugins -- table within the setup call below. M.setup({ plenary = "https://github.com/nvim-lua/plenary.nvim.git", telescope = "https://github.com/nvim-telescope/telescope.nvim", diffview = "https://github.com/sindrets/diffview.nvim", neogit = "https://github.com/NeogitOrg/neogit", }) -- WARN: Do all plugin setup, test runs, reproductions, etc. AFTER calling setup with a list of plugins! -- Basically, do all that stuff AFTER this line. require("neogit").setup({}) -- For instance, setup Neogit
Never mind, I managed to reproduce it with a minimal config. What I did was:
git reset --hard HEAD~1
in a separate terminalWhen I came back, I saw this (notice Neogit hasn't shown the new state yet: the unmerged commit should be gone):
Updating my issue with the minimal config.
I can't tell for sure but it looks like this isn't happening if Neogit is in its own tab. It happens when kind=vsplit
(sharing a tab with other non-Neogit windows)?
Just saw this happen on my kind=tab
Neogit instance.
@CKolkey Even though I have reproduced this with a minimal config, I am worried that it may still be an issue with my setup. Do you have the same impression?
It's making using Neogit really hard for me. The UI glitches a bit every time I see this error, and in some cases it happens a lot (like 10s of times per second).
Any idea what could be causing it on my side, if that's the case?
It might be related to the filewatcher.. You could try disabling that. I feel bad that this is getting in your way, but just to be above board with things, my wife is pregnant right now, and I don't have a lot of time to triage things.
Anyways. I did git reset --hard HEAD~1
in a separate terminal with neogit open and it just works fine :\
:smile: Enjoy your time! I'll try to figure this out own my own. THX
@CKolkey congrats! ๐ ๐ถ๐ผ
I also have the same issue, and use kind=tab
exclusively. Disabling filewatcher
has seemed to help.
I have the same issue using kind=tab
.
It's happening with me as well, after disabling filewatcher
, I'm not having the issue.
@CKolkey congrats! ๐ and, thank you for the work done so far here!
Yep, filewatcher = { enabled = false }
is a workaround.
It seems like there is a filewatcher implementation problem where filewatcher events are pointing at the wrong window when the UI tries to update.
Is there a known good commit?
~Reverting to 98b72c075844aa28338729ffdc9fe8b58e4e7684 seemed to work for me.~
I'm also seeing this error when you edit a commit even with the filewatcher disabled and kind = 'vsplit'
I think this is resolved? I reworked how the filewatcher handles things. Feel free to reopen if you experience it any more :)
Seems to be fixed for me
Description
While using Neovim, I get
messages
popping up async (not directly during or after an action) sayingInvalid buffer id: <some buffer id>
.This seems to manifest in that
Neogit
no longer shows up-to-date information (e.g. I know I've staged some changes, but the UI has not updated, or I know I've committed, but there are still staged changes inNeogit
, sometimes with duplicated things like the same staged file listed twice).Dump of
messages
:Neovim version
NVIM v0.10.0 Build type: Release LuaJIT 2.1.1693350652
Operating system and version
Linux feanor 6.8.12 #1-NixOS SMP PREEMPT_DYNAMIC Thu May 30 07:49:53 UTC 2024 x86_64 GNU/Linux
Steps to reproduce
Neogit
Neogit
stateExpected behavior
messages
Neogit
reflects realityActual behavior
messages
Neogit
sometimes out of date, sometimes with duplicated things like the same staged file listed twiceMinimal config