Merge pull request #845 from wcandillon/master
Disable buggy XQuery behavior (#844)
This commit is contained in:
commit
4c3ab0e3df
2 changed files with 33 additions and 33 deletions
|
|
@ -28,39 +28,39 @@ define(function(require, exports, module) {
|
|||
this.inherit(CstyleBehaviour, ["braces", "parens", "string_dquotes"]); // Get string behaviour
|
||||
this.parent = parent;
|
||||
|
||||
this.add("brackets", "insertion", function (state, action, editor, session, text) {
|
||||
if (text == "\n") {
|
||||
var cursor = editor.getCursorPosition();
|
||||
var line = session.doc.getLine(cursor.row);
|
||||
var rightChars = line.substring(cursor.column, cursor.column + 2);
|
||||
if (rightChars == '</') {
|
||||
var indent = this.$getIndent(session.doc.getLine(cursor.row)) + session.getTabString();
|
||||
var next_indent = this.$getIndent(session.doc.getLine(cursor.row));
|
||||
|
||||
return {
|
||||
text: '\n' + indent + '\n' + next_indent,
|
||||
selection: [1, indent.length, 1, indent.length]
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
// this.add("brackets", "insertion", function (state, action, editor, session, text) {
|
||||
// if (text == "\n") {
|
||||
// var cursor = editor.getCursorPosition();
|
||||
// var line = session.doc.getLine(cursor.row);
|
||||
// var rightChars = line.substring(cursor.column, cursor.column + 2);
|
||||
// if (rightChars == '</') {
|
||||
// var indent = this.$getIndent(session.doc.getLine(cursor.row)) + session.getTabString();
|
||||
// var next_indent = this.$getIndent(session.doc.getLine(cursor.row));
|
||||
//
|
||||
// return {
|
||||
// text: '\n' + indent + '\n' + next_indent,
|
||||
// selection: [1, indent.length, 1, indent.length]
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return false;
|
||||
// });
|
||||
|
||||
// Check for open tag if user enters / and auto-close it.
|
||||
this.add("slash", "insertion", function (state, action, editor, session, text) {
|
||||
if (text == "/") {
|
||||
var cursor = editor.getCursorPosition();
|
||||
var line = session.doc.getLine(cursor.row);
|
||||
if (cursor.column > 0 && line.charAt(cursor.column - 1) == "<") {
|
||||
line = line.substring(0, cursor.column) + "/" + line.substring(cursor.column);
|
||||
var lines = session.doc.getAllLines();
|
||||
lines[cursor.row] = line;
|
||||
// call mode helper to close the tag if possible
|
||||
parent.exec("closeTag", lines.join(session.doc.getNewLineCharacter()), cursor.row);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
// this.add("slash", "insertion", function (state, action, editor, session, text) {
|
||||
// if (text == "/") {
|
||||
// var cursor = editor.getCursorPosition();
|
||||
// var line = session.doc.getLine(cursor.row);
|
||||
// if (cursor.column > 0 && line.charAt(cursor.column - 1) == "<") {
|
||||
// line = line.substring(0, cursor.column) + "/" + line.substring(cursor.column);
|
||||
// var lines = session.doc.getAllLines();
|
||||
// lines[cursor.row] = line;
|
||||
// // call mode helper to close the tag if possible
|
||||
// parent.exec("closeTag", lines.join(session.doc.getNewLineCharacter()), cursor.row);
|
||||
// }
|
||||
// }
|
||||
// return false;
|
||||
// });
|
||||
}
|
||||
oop.inherits(XQueryBehaviour, Behaviour);
|
||||
|
||||
|
|
|
|||
|
|
@ -157,9 +157,9 @@
|
|||
}
|
||||
|
||||
.ace-tm .ace_meta.ace_tag {
|
||||
color:rgb(0, 50, 198);
|
||||
color:rgb(0, 22, 142);
|
||||
}
|
||||
|
||||
.ace-tm .ace_string.ace_regex {
|
||||
color: rgb(255, 0, 0)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue