From 69b40db4f2b713ad0cdd973bcc0bd35597ea644e Mon Sep 17 00:00:00 2001 From: Robert Krahn Date: Mon, 25 Nov 2013 18:11:15 -0800 Subject: [PATCH] fix cstyle behaviour when inserting braces and doing a newline. Previous behaviour would not add a closing brace when no other opening brace was present --- lib/ace/mode/behaviour/cstyle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/mode/behaviour/cstyle.js b/lib/ace/mode/behaviour/cstyle.js index 54f75526..2c831667 100644 --- a/lib/ace/mode/behaviour/cstyle.js +++ b/lib/ace/mode/behaviour/cstyle.js @@ -166,7 +166,7 @@ var CstyleBehaviour = function () { } var rightChar = line.substring(cursor.column, cursor.column + 1); if (rightChar == '}' || closing !== "") { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column}, '}'); + var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); if (!openBracePos) return null;