-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
saved files keep disappearing from arrow list #68
Comments
Narrowed this down a bit - all I have to do is open neogit status and then exit the status. Arrow will then report "no files yet" when opening the UI. If I restart nvim then the UI is populated with what I expect (until I look at neogit again) |
Maybe your working directory(cwd) is changed when open neogit |
Yes, it is changed when in neogit status to the git repo root, but when neogit status buffer is closed then cwd() is the same as it was before opening neogit |
Why not keep you cwd the same as git root, arrow persist files by cwd by default, you can also make it persist by git root. |
Because I don't want it to be. E.g. for for working specifically within a subdir of the repo. |
From what I can tell, arrow doesn't correctly handle the case where :lcd is used, followed by a buffer change - the global state needs to be refreshed on BufEnter (not only BufReadPost)? |
I am having the same issue, any updates on this? |
I have made this work around to my perrsonal config -- this hack removes the 'reload arrow state on DirChanged' autocmd to fix the bug
-- where it loads state for git root when opening NeogitStatus, but does not reload state
-- when leaving NeogitStatus
local autoc_id = vim.api.nvim_get_autocmds({group="arrow", event="DirChanged"})[1].id
if autoc_id then
vim.api.nvim_del_autocmd(autoc_id)
vim.api.nvim_create_autocmd({ "DirChanged" }, {
callback = function ()
local config = require("arrow.config")
local persist = require("arrow.persist")
local git = require("arrow.git")
local file_name = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), ":t")
if file_name == "NeogitStatus" then
return
end
git.refresh_git_branch()
persist.load_cache_file()
config.setState("save_key_cached", config.getState("save_key")())
end,
desc = "load cache file on DirChanged",
group = "arrow",
})
end
|
My list(s) of saved files keeps getting cleared out - I will have 3,4,5 files in the ui one second, then the next time I open the ui the list is empty.
My lazy config is,
As you can see I will be using the default scope - I thought this should be cwd? I don't
:cd
once I'm in nvim.It's a bit inconsistent when the list disappears. I'm wondering if there is some implicit link to git commit or something? feels like things go wrong after committing some files, but not certain on that
The text was updated successfully, but these errors were encountered: