Moved text editor command to constant, made some other minor updates such as handling the case when no matches are found.