Redmine #4733: Make edit_line CRLF aware + plus minor stuff