restore screen position and confirm if filetype is markdown

because trailing spaces in markdown are not meaningless.