3 ms·
Thanks for the elaborate explanation! Ps what do you mean by perstisting the open buffers, are they at any time in sync with a file, or are the buffers shared v
by nuancebydefault 4y ago
Thanks for the elaborate explanation! Ps what do you mean by perstisting the open buffers, are they at any time in sync with a file, or are the buffers shared via another mechanism?
- vidarh 4y agoThe editor is client-server using Drb (I'm considering changing the use of Drb; Drb is very easy to get running but you get little control over the interface; it's a bit too good at being transparent) Originally I did it as a quick way of ensuring I didn't lose data when I started using it, as Drb will forward exceptions as well, so the backend just won't crash, so as long as you don't do anything which corrupts the buffers you're good. Instead the frontend may crash (and throw me into a Pry repl, where I can query the backend and make sure I can recover the buffers), and I can just restart the frontend on the same buffer and keep working. (In practice it mostly crashes when I am using it to edit itself) As an extra precaution I made it serialise all the open buffers to disk regularly. So I can just shut down my machine and next time I open all the buffers are still there (like Emacs etc. it'll warn me if the file has been edited since the buffer was opened). Eventually this also gave me multi-frame support "for free" in that splitting the buffer vertically or horizontally just spawns a new instance of the editor and attaches to the same buffer (and then you can open whatever you want in it)