otavioschwanck / arrow.nvim

Bookmark your files, separated by project, and quickly navigate through them.
Other
341 stars 16 forks source link

saved files keep disappearing from arrow list #68

Open Amleto opened 1 month ago

Amleto commented 1 month ago

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,

return {
  "otavioschwanck/arrow.nvim",
  event = "VeryLazy",
  opts = {
    show_icons = true,
    leader_key = ' h', -- Recommended to be a single key
    buffer_leader_key = ' m', -- Per Buffer Mappings
    window = {
      border = "rounded",
    },
  },

  config = function(_, opts)
    require('arrow').setup(opts)
    local linenr_settings = vim.api.nvim_get_hl(0, {name='LineNr', link=false})
    vim.api.nvim_set_hl(0, 'ArrowBookmarkSign', {bg=linenr_settings.bg, fg="#d093c7"})
  end
}

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

Amleto commented 1 month ago

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)

xzbdmw commented 1 month ago

Maybe your working directory(cwd) is changed when open neogit try :=vim.uv.cwd()

Amleto commented 1 month ago

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

xzbdmw commented 1 month ago

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.

Amleto commented 1 month ago

Because I don't want it to be. E.g. for for working specifically within a subdir of the repo.

Amleto commented 1 month ago

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)?