smart-splits.nvim icon indicating copy to clipboard operation
smart-splits.nvim copied to clipboard

Reduce number of reloads while resizing?

Open ttytm opened this issue 3 years ago • 1 comments

I found that a lot is going on during resizing with smart-splits. Even when using a decent machine, this often produces a latency compared to regular resizing .

An example that makes it very visible is when using a statusline line like galaxyline. The statusline flashes between active and inactive mode on every resize step.

Another example is when opening two splits from different working directories and additionally a file tree that adapts to the working directory of the active buffer like nvim-tree. Using smart splits, the file tree flashes between the working directories with every resize step.

Depending on the tree plugin, and it's configuration smart-splits behavior also changes visible directories.

Working on a decent machine this won't produce peaks in system workload or something. Still, performing multiple resize steps in a row using smart splits often has a recognizable latency compared to regular resizing. But for those working on a weaker system, those become pretty recognizable lags.

Is this much processing and switching between buffers necessary for the plugins to work? If are there any ideas or plans for further development you can share, maybe the community can help with some implementations.

ttytm avatar Jul 14 '22 18:07 ttytm

I'm not sure how I can do it and still catch all the edge cases I'm handling.

mrjones2014 avatar Jul 20 '22 11:07 mrjones2014

Had it in the back of my mind that I opened this issue. Wanting to check back on it and implement some caching I've seen you have already implemented it. I guess it's as much resolved as it can get.

Gonna take the freedom to close this issue.

ttytm avatar Oct 03 '22 13:10 ttytm

Today I learned that winnr('h')/winnr('j')/winnr('k')/winnr('l') can be used to determine if you're at an edge window so I should be able to compute edges in fewer steps using this.

mrjones2014 avatar Oct 13 '22 12:10 mrjones2014