I'm not sure this is the issue because, to be precise, the workaround here is to use a keyboard shortcut to jump from start to end line or from word to word.
If I create a page with content (without space at the start), I can use CTRL + ← or CTRL + → to jump at the start before the code macro and type text or after.
{{code}}some code{{/code}} some text
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.