Start to tag someone with the @ key. Once you've entered the name of that person, and the menu pops up with users to select, press enter and it will leave a space instead of a new line.
Screenshot:
Tested on Google Chrome. Not sure about the other browsers.
The difference is, certainly on the second scenario, I generally use the keyboard to select the name of the person I'm tagging and then hit enter to confirm. So, I definitely wouldn't want a new line to appear as a result of me using enter to select a user.