Fixes 5412 (enter key broken in code hints)

Bisect found 4d8924c to be the problem, so this change rolls back the whole pull request.

Revert "Merge pull request #3406 from WebsiteDeveloper/Issue-1617"

This reverts commit 2d350a5305beec1d282f700bf9d2b360e19a76a7, reversing
changes made to d7fa08d20533766f77609c9969f3976500786fb0.