In a project I’m working on, I’ve got different pieces of data that are pulled from an API and I want to be able to show it in buffers. If I pull data and use nvim_create_buffer()
then set lines with some data to make buffer 2
, and do the same to make another buffer (call it 3
), how do I make these buffers work with the jumpstack where you can go from 2 to 3, and jump back and forth? It looks like if I create both buffers, they both show as valid and loaded, but if I go from one to the other, the one I just left becomes unloaded and invalid. I understand buffers get unloaded and free’d, but I wasn’t aware that leaving it made it invalid.
So, tl;dr: how can I keep a buffer and it’s contents (not from a file) when I leave it via jumping, and be able to come back to it and it’s previous state? Do I have to use temp files?