Place cursor between formatting characters when using formatting shortcuts
When a formatting shortcut is used without a selection, previously the cursor would be put at the end of the inserted formatting characters (**|). This merge refactors the format functions into a single function that puts the cursor between them if no selection has been made (**|) so you can start typing formatted characters immediately.