fix #383 - improve handling of read-only files
Fix repeat of insert

Fixed the issue that repeat by '.' after inserting characters by 'i'
doesn't work.