fix quote pairing for "\n"
This commit is contained in:
parent
af5c7a9c3b
commit
a799a4086f
2 changed files with 12 additions and 2 deletions
|
|
@ -144,6 +144,16 @@ module.exports = {
|
||||||
exec("selectleft", 1);
|
exec("selectleft", 1);
|
||||||
exec("insertstring", 1, '"');
|
exec("insertstring", 1, '"');
|
||||||
assert.equal(editor.getValue(), '("foo")');
|
assert.equal(editor.getValue(), '("foo")');
|
||||||
|
|
||||||
|
editor.setValue("", 1);
|
||||||
|
exec("selectleft", 1);
|
||||||
|
exec("insertstring", 1, '"');
|
||||||
|
assert.equal(editor.getValue(), '""');
|
||||||
|
exec("insertstring", 1, '\\');
|
||||||
|
exec("insertstring", 1, 'n');
|
||||||
|
exec("insertstring", 1, '"');
|
||||||
|
assert.equal(editor.getValue(), '"\\n"');
|
||||||
|
|
||||||
},
|
},
|
||||||
"test: xml": function() {
|
"test: xml": function() {
|
||||||
editor = new Editor(new MockRenderer());
|
editor = new Editor(new MockRenderer());
|
||||||
|
|
|
||||||
|
|
@ -269,8 +269,8 @@ var CstyleBehaviour = function() {
|
||||||
if (leftChar == "\\" && token && /escape/.test(token.type))
|
if (leftChar == "\\" && token && /escape/.test(token.type))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var stringBefore = token && /string/.test(token.type);
|
var stringBefore = token && /string|escape/.test(token.type);
|
||||||
var stringAfter = !rightToken || /string/.test(rightToken.type);
|
var stringAfter = !rightToken || /string|escape/.test(rightToken.type);
|
||||||
|
|
||||||
var pair;
|
var pair;
|
||||||
if (rightChar == quote) {
|
if (rightChar == quote) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue