nvimdev / indentmini.nvim

A minimal and blazing fast indentline plugin
MIT License
171 stars 12 forks source link

Indent guides only show up in the current window when there are multiple files open on the same tab #13

Closed igorlfs closed 4 months ago

igorlfs commented 4 months ago

Hey, thanks for the plugin!

Reproduction steps:

  1. Open a file (eg, :e my-file)
  2. Open another file (eg, :vsplit + :e my-other-file)

Indent guides will only show up in the other file, instead of showing up in both files.

I understand this could be by design, to avoid drawing virtualtext where the user can't see, but currently it feels too extreme.

glepnir commented 4 months ago

yup i disable it on non current win avoid wasting time on unimportant rendering

https://github.com/nvimdev/indentmini.nvim/blob/a84db978001610a7f6eb3be5b844f3206d081abc/lua/indentmini/init.lua#L101-L106

glepnir commented 4 months ago

Sorry I may have closed this issue rudely. For now I want to keep it minimal and i have update doc for the way it works.

WieeRd commented 2 months ago

Do you have any plans to make this behavior controllable via setup options? Is there something tied to current implementation that makes it hard to support multiple windows?

glepnir commented 2 months ago

In short, I only want to see the indent lines in the buffer I am currently in and I can minimize the current code. indentmini works in the redraw loop of neovim.

WieeRd commented 2 months ago

I understand your preference towards only enabling indentation guides for the focused window. And since it is your plugin that you mainly built for yourself, it totally makes sense to be the default behavior.

What I'm asking is:

glepnir commented 2 months ago

Do you at least plan to make this an opt-out settings in the future, so that people who do want the indentation guides in every window can enable it?

currently in on_win it check the bufnr ~= api.nvim_get_current_buf() if remove this line i think it can be work , if no too much code on this PR welcome.

WieeRd commented 2 months ago

I forgot to comment the results. If anyone has stumbled upon this issue, simply removing the bufnr check did not work correctly. And looking at the related code context I realized quite a bit of work would have to be done to support it. Only focusing on the current window really did simplify the code and improve performance, but it you want multi-window support you should probably look for an alternative plugin.