Save and load the folding of the document and place the cursor at the position when file was closed