moe icon indicating copy to clipboard operation
moe copied to clipboard

Backup state of modified buffers, when crashing

Open tobimensch opened this issue 3 years ago • 0 comments

I just hit on a bug and lost two lines I had written, not a big deal, but this type of bug is a showstopper.

I know what to expect from 0.2.x software, so this isn't too bad.

Bugs can always be there, even in mature software, so the right thing to do here, is to catch as many types of crashes as possible, and make sure to save a backup of all opened buffers, especially those who were modified and not written to disk yet.

Then when moe is reopened it should show a message indicating that crash buffer backups were saved and where they can be found.

With this I'd feel much more confident in using moe.

The bug I ran into when I thought of this change being needed was, that when making a selection one of the last lines with v and then extending that selection to the end of the document and hitting either d or x while the extension is active, it crashes with:

fatal.nim(49)            sysFatal
Error: unhandled exception: gapbuffer.nim(142, 11) `0 <= index and index < gapBuffer.size` Gapbuffer: Invalid index. index = 12, gapBuffer.size = 12 [AssertionError]

I could open a new bug report for this, however I thought it would also be a good test for the better crash handling I think we should have in moe.

tobimensch avatar Jul 09 '20 22:07 tobimensch