Enter key breaking undo functionality

Tested in Chrome on macOS

Steps to reproduce:

  1. On a pull request, start a review
  2. Start writing a comment
  3. In your comment, select a piece of text and hit enter
  4. Hit cmd + z

Expected result
The new line is removed and the deleted text text reappears.

Actual result
Hitting the enter key cannot be undone. This also applies to regular new lines but is less bad in this scenario as you don’t lose your edit like when you had text selected.