You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am curious how you figured out how to do this. It turns out it's incredibly hard, and not 100% possible when considering windows that have splits. Have you found the same?
Took me a while to think of a good solution for this problem, because there's no auto command available that covers all the cases of leaving a buffer/window/split.
What I ended up doing is keeping an object that stores the cursor line for each window/split/buffer you're in. I update this object on every cursor movement. (This sounds like it can slow vim down, but it's only updating a single variable. From my experience it didn't slow anything down).
Then on the autocommand "WinEnter" I loop through all the buffers and align their cursors and the top line to what they were just before the WinEnter command (which is just before the windows alignment moved).
I think the code is pretty readable, I tried to add comments so I'll remember what I did myself :)
But if you have any questions i'll be happy to help.
https://github.com/gillyb/stable-windows
@gillyb - looks like we have some overlapping code/purposes.
The text was updated successfully, but these errors were encountered: