From 6953b175a179e763d8a1659c0287be1ec531facc Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Wed, 24 Oct 2012 10:53:32 +0200 Subject: [PATCH] Don't insert quotes before text or around other quotes --- lib/ace/mode/behaviour/cstyle.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ace/mode/behaviour/cstyle.js b/lib/ace/mode/behaviour/cstyle.js index 346b5867..e05bc5b7 100644 --- a/lib/ace/mode/behaviour/cstyle.js +++ b/lib/ace/mode/behaviour/cstyle.js @@ -243,12 +243,12 @@ var CstyleBehaviour = function () { var quote = text; var selection = editor.getSelectionRange(); var selected = session.doc.getTextRange(selection); - if (selected !== "") { + if (selected !== "" && selected !== "'" && selected != '"') { return { text: quote + selected + quote, selection: false }; - } else { + } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { var cursor = editor.getCursorPosition(); var line = session.doc.getLine(cursor.row); var leftChar = line.substring(cursor.column-1, cursor.column);