             @parameterPopUp.css 'top', "12px"
             @parameterPopUp.css 'left', gutterOffset + 5
 
+            # Prevents the ace editor from stealing focus
+            @parameterPopUp.mousedown (mousedownEvent) ->
+                mousedownEvent.stopPropagation()
+                return
+
             @parameterPopUp.show()
             setTimeout (-> jQuery("##{command}-parameter-#{1}").focus(); return), 0
             clickEvent.stopPropagation()

            code += '\n' + @hiddenSuffix
        return code

                
    gotoLine: (row) ->
        column = @editor.getCursorPosition().column
        @editor.gotoLine row, column, true

                usesRemaining = remaining[command]
            else
                usesRemaining = @commands[command]['usesRemaining']


            button.attr 'title',@toUsesRemainingText(usesRemaining, @commands[command].maxUses)
            if usesRemaining <= 0
                button.attr 'disabled', true
