Restore files states (fixed #234)

Restore scrollPosition and cursor position of files even if the file is closed.

@devoncarew