             replacementText = @applyCase(@invertString(text), currentCase)
 
             if replacementText
-                selection.insertText(replacementText, {select: true})
+                selection.insertText(replacementText, {select: userSelected})

        for selection in selections
            do (selection) ->
            text = selection.getText()

            # If nothing is selected select the current word
            if !text
                selection.selectWord()
                text = selection.getText()

            # Save the current casing to restore it afterwards
            currentCase = @detectCase(text)

    keywords:
        # array
        "join": "split"
        "pop": "push"
        "reduce": "reduceRight"
        "shift": "unshift"
        # boolean
        "and": "nand"
        "false": "true"
        "nor": "or"
        "xnor": "xor"
        # brackets
        "(": ")"
