Isrothy/neominimap.nvim

Changed lines show in wrong spot.

JoseConseco opened this issue · 4 comments

Describe the bug
The changed git lines, are not shown in proper place.
In red I highlighted where minimap shows it, in green - where changed git lines are.

To Reproduce
Not sure, but problem is gone if I disable folding, and reload minimap.

Expected behavior
Changed lines should be shown few lines up in minimp

Screenshots
image

Please complete the following information:

  • OS: Linux.
    NVIM v0.10.1
    Build type: Release
    LuaJIT 2.1.1720049189

Additional context
I tried to reload minimap but it would not help. Disabling code folding in my buffer helps... But it is not fix..

my setup

    init = function()
      -- The following options are recommended when layout == "float"
      vim.opt.wrap = false
      vim.opt.sidescrolloff = 36 -- Set a large value

      --- Put your configuration here
      ---@type Neominimap.UserConfig
      vim.g.neominimap = {
        auto_enable = true,

        layout = "float",
        float = { z_index = 10 },
        diagnostic = {
          enabled = false,
        },
        git = {
          enabled = true,
          mode = "line",
        },
        search = {
          enabled = true,
          mode = "sign",
        },
        win_filter = function(winid)
          return winid == vim.api.nvim_get_current_win()
        end,
      }
      -- link NeominimapGitAddLine highlight to DiffAdd
      vim.api.nvim_set_hl(0, "NeominimapGitAddLine", { link = "DiffAdd" })
      vim.api.nvim_set_hl(0, "NeominimapGitChangeLine", { link = "DiffChange" })
      vim.api.nvim_set_hl(0, "NeominimapGitDeleteLine", { link = "DiffDelete" })
    end,

This issue is related to foldings. I'm going to fix this soon.

Could you checkout #137 and see if it resolves the issue you’ve encountered? Your feedback would be greatly appreciated!

{
    "Isrothy/neominimap.nvim",
    branch = 'fix-annotation-folding',

    --- Your configurations:
}

Yes it works great now. That was fast.
btw. I was thinking - if u could expose option to show minimap only for current buffer / Window.
I made it work with

        win_filter = function(winid)
          return winid == vim.api.nvim_get_current_win()
        end,

But imo, this would be convenient as option in config. Thanks for the fix.

Thank you for the suggestion! However, I’d like to keep this plugin as simple as possible. The win_filter option exists specifically to give users the flexibility to handle cases like this themselves. I believe that adding this as a built-in option might complicate the configuration unnecessarily.

That said, I think it’s a great idea to document this use case, so I’ll add it to the wiki. Thanks again for your input!