fixes the 'C-style {}' logic.  inserts correct brackets depending on beginning cursor location and ending cursor location