Closed stevearc closed 1 year ago
Moving the discussion of cursor position here so we can track separately.
This does clarify things! We persist the cursor position for all windows, but don't store the last cursor position for any buffers that are not open in a window. I haven't personally felt the need for this because I use the autocmd mentioned in :help restore-cursor
, but I think the request is reasonable and makes sense. I'll look into making this work.
splendid!
The implementation was easier than I thought. Give it a try; it worked fine in my testing but there may be some edge cases
Works flawlessly! maybe add a config option to disable this feature (I'd vote for it to stay enabled by default tho).
Even better than a repro, A showcase of the "issue".
Notice:
main.lua:3
andside.lua:2
main.lua
is open.main.lua
is naturally restored (as you've noted)side.lua
cursor position is reset to the top (the issue)The issue is that resession is only saving a single cursor position, what I want is for it to save a cursor position for each file (not open buffers)
I hope this has made it clearer.
Originally posted by @RaafatTurki in https://github.com/stevearc/resession.nvim/issues/1#issuecomment-1298761420