Added line to keep cursor position when leaving zen-mode.
See issue #19.
I've tested and it works. I activate zen when entering Insert Mode and deactivate it on leaving. Kudos to you, I'm no longer going insane. :-)
@nasanos Would it be possible to update this to also synchronize the scroll position? As it is now, I'm guessing it's possible for the cursor to be at the top of the Zen window, then at the bottom of the original window when exiting Zen mode.
Synchronizing the scroll position would be a nice touch, making it slightly less jarring to return to the original window, as the windows would look identical (at least if they were the same height.)
@Hubro I definitely like that idea, and, from what I recall, I think it would be doable, though I need to look through the code again to be sure. Other responsibilities mean it may take me a while, but I can start looking into what it would take to add that feature as well.
@nasanos If you want to go all the way, you could continuously keep the cursor position and scroll position in sync with the original window using autocommands. I know there are events both for cursor move and window scroll, so it's definitely doable. The advantage of this would be that plugins that depend on the scroll position, such as nvim-scrollview, would keep working.
:tada: