Implement END and HOME for text edits

Disregard the unrelated branch name.