diff --git a/lib/ace/mode/behaviour/cstyle.js b/lib/ace/mode/behaviour/cstyle.js index ba9d7c3f..d8df3b31 100644 --- a/lib/ace/mode/behaviour/cstyle.js +++ b/lib/ace/mode/behaviour/cstyle.js @@ -151,7 +151,12 @@ var CstyleBehaviour = function () { if (text == '[') { var selection = editor.getSelectionRange(); var selected = session.doc.getTextRange(selection); - if (selected === "") { + if (selected !== "") { + return { + text: '[' + selected + ']', + selection: false + }; + } else { return { text: '[]', selection: [1, 1]