FMCorz / mdk

Moodle Development Kit. A collection of tools meant to make developers' lives easier.
GNU General Public License v3.0
85 stars 47 forks source link

Create editor temporary files in a known temp directory #108

Open andrewnicols opened 9 years ago

andrewnicols commented 9 years ago

Before putting comments in, it would be super awesome if we could make sure that we create them somewhere we can easily find them again if the update fails.

FMCorz commented 9 years ago

Thanks Andrew,

I am unsure about the new directory, we can maybe just use dirs.moodle in the background with new sub directory 'editor' or so. Though I'm not entirely sure this feature would be useful as you will have a high number of files over time and finding the one you're looking will be tedious, and limited to the few developers who are aware of the feature.

Maybe the right solution is to create a new editor class, which takes an editor intent (comment, pr comment, testing instructions, commit message), saves the content in a temporary file, and gets notified on success in which case the content is deleted. Otherwise the same intent will restore the last content saved.

All in all, the whole thing is a lot of work for little benefit. At the same time this feature is not reliable if you can lose the long text you wrote... I'm on the fence :)