Go to last put cursor in correct place; avoid new line at eof when folding

ref #44