gorbit99 / codewindow.nvim

MIT License
431 stars 16 forks source link

feat(window): allow setting minimap as relative to editor #56

Closed akinsho closed 1 year ago

akinsho commented 1 year ago

Hi,

This is a PR to allow setting the minimap to be relative to the entire editor rather than just the window. The issue I encountered using just the window is that if you have multiple splits it tries to squash itself into quite a small space obscuring text.

I've just allowed the user to pass the relative value for the window directly rather than using a boolean configuration so it can be adapted if there is some other relevant value in the future.

gorbit99 commented 1 year ago

Neat feature, thanks!

pocco81 commented 1 year ago

Hmm I think it was a bit of an odd choice to move the minimap 1 cell to the left. This makes the cursorline visible there:

image

Solution: remove the -1 here, at the far right.

akinsho commented 1 year ago

I'm happy/fine for this to be changed 🤷🏾‍♂️, it looks a little less odd/out of place using a border with the window.

pocco81 commented 1 year ago

Yeah I think the window's position (column) depends on the user's preference. I use a border-less terminal so I want it to be touching the right-hand side border. Others might use scrollbars (like on VSCode), so I guess they wouldn't want the minimap overlapping it.

Maybe this could be a setting on the user's config? Something like this:

win = {
    style = "...",
    relative = "..."
    col = function() ... end,
    row = function() ... end,
}
akinsho commented 1 year ago

Yeah I think tbh that the window options should all be configurable, although I don't know if there are some it will complicate the plugin for the user to have control of in which case those should be omitted in either case up to @.gorbit99

gorbit99 commented 1 year ago

I'll try to put this in over the weekend. Should probably just add in that win table into the config table, and then pass that straight over to the window creation function. (Minus some options, that would be either duplicated, or wouldn't make sense)