Allow multiple bracket closing insertionss like {{{}}}
This commit is contained in:
parent
5ed0998ce7
commit
b126f5d314
1 changed files with 4 additions and 5 deletions
|
|
@ -45,15 +45,14 @@ var CstyleBehaviour = function () {
|
||||||
if (!this.$matchTokenType(iterator.getCurrentToken() || "text", ["text"])) {
|
if (!this.$matchTokenType(iterator.getCurrentToken() || "text", ["text"])) {
|
||||||
// Look ahead in case we're at the end of a token
|
// Look ahead in case we're at the end of a token
|
||||||
iterator = new TokenIterator(session, cursor.row, cursor.column + 1);
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't insert in front of identifiers or brackets
|
// Only insert in front of whitespace/comments
|
||||||
iterator.stepForward();
|
iterator.stepForward();
|
||||||
if (this.$matchTokenType(iterator.getCurrentToken() || "text", ["identifier", "paren.lparen"]))
|
return iterator.getCurrentTokenRow() !== cursor.row ||
|
||||||
return false;
|
this.$matchTokenType(iterator.getCurrentToken() || "text", ["text", "comment", "paren.rparen"]);
|
||||||
return true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CstyleBehaviour.$matchTokenType = function(token, types) {
|
CstyleBehaviour.$matchTokenType = function(token, types) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue