Ramilito / kubectl.nvim

Apache License 2.0
165 stars 5 forks source link

feat: separate buffer and content creation #145

Closed Ramilito closed 1 month ago

Ramilito commented 1 month ago

The hack with opening a buffer before loading content was causing issues when trying to do the fit to size buffer, since when we deleted or changed the rows in that floating buffer, there would be artifacts in the background.

This pr solves the hack to always preload the buffer and then setting the content instead or reopening it. This pr also creates a new buffer type that is meant to adjust to the content. This pr uses extmarks with virt_text for the divider otherwise it's difficult to determine what the max_width of regular content is.

This might have some bugs that I haven't discovered, so limiting the usage to namespace view, help view and PortForward view for now.