ajaxorg/cloud9 — pull request #2628 by janjongboom (2013-01-08 12:27:55+00:00)
Title: Autosave trashes file

This fixes the possibility of autosave trashing a file when closing it before the autosave kicks in. It now saves nicely.

However, there is a bug left that I can't tackle, and that is that when you do the closing before autosave, autosave won't work on that file anymore. The reason for this is:

* Check the model in `autosave@save`
* Check the model in `editors.js page.$at.addEventListener("afterchange", function(e) {`

They differ?! One seems to be a concorde document or something, and the other a normal one. Anyway they are not connected anymore and thus doesn't autosave detect that content has changed. If anyone wants to look at this (@javruben ?) feel free. I have no clue.