Allow multiple bracket closing insertionss like {{{}}}

This commit is contained in:
Lennart Kats 2012-10-18 15:32:31 +02:00
commit b126f5d314

View file

@ -45,15 +45,14 @@ var CstyleBehaviour = function () {
if (!this.$matchTokenType(iterator.getCurrentToken() || "text", ["text"])) {
// Look ahead in case we're at the end of a token
iterator = new TokenIterator(session, cursor.row, cursor.column + 1);
if (!this.$matchTokenType(iterator.getCurrentToken() || "text", ["text"]))
if (!this.$matchTokenType(iterator.getCurrentToken() || "text", ["text", "paren.rparen"]))
return false;
}
// Don't insert in front of identifiers or brackets
// Only insert in front of whitespace/comments
iterator.stepForward();
if (this.$matchTokenType(iterator.getCurrentToken() || "text", ["identifier", "paren.lparen"]))
return false;
return true;
return iterator.getCurrentTokenRow() !== cursor.row ||
this.$matchTokenType(iterator.getCurrentToken() || "text", ["text", "comment", "paren.rparen"]);
};
CstyleBehaviour.$matchTokenType = function(token, types) {