do not pair quotes inside strings
This commit is contained in:
parent
ec18d9493d
commit
6b13aedf5f
2 changed files with 11 additions and 0 deletions
|
|
@ -120,6 +120,15 @@ module.exports = {
|
|||
assert.equal(editor.getValue(), "{")
|
||||
exec("insertstring", 1, "\n");
|
||||
assert.equal(editor.getValue(), "{\n \n}")
|
||||
|
||||
editor.setValue("");
|
||||
exec("insertstring", 1, "(");
|
||||
exec("insertstring", 1, '"');
|
||||
exec("insertstring", 1, '"');
|
||||
assert.equal(editor.getValue(), '("")');
|
||||
exec("backspace", 1);
|
||||
exec("insertstring", 1, '"');
|
||||
assert.equal(editor.getValue(), '("")');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -277,6 +277,8 @@ var CstyleBehaviour = function() {
|
|||
} else {
|
||||
if (stringBefore && !stringAfter)
|
||||
return null; // wrap string with different quote
|
||||
if (stringBefore && stringAfter)
|
||||
return null; // do not pair quotes inside strings
|
||||
var wordRe = session.$mode.tokenRe;
|
||||
wordRe.lastIndex = 0;
|
||||
var isWordBefore = wordRe.test(leftChar);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue