stevearc / resession.nvim

A replacement for mksession with a better API
MIT License
178 stars 13 forks source link

Persist cursor position per-buffer #2

Closed stevearc closed 1 year ago

stevearc commented 1 year ago

I'm a bit confused about the question of persisting cursor positions ...

Even better than a repro, A showcase of the "issue".

Notice:

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

stevearc commented 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.

RaafatTurki commented 1 year ago

splendid!

stevearc commented 1 year ago

The implementation was easier than I thought. Give it a try; it worked fine in my testing but there may be some edge cases

RaafatTurki commented 1 year ago

Works flawlessly! maybe add a config option to disable this feature (I'd vote for it to stay enabled by default tho).