New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not auto-close when ending with open #55315

Merged
merged 3 commits into from Sep 5, 2018
Jump to file or symbol
Failed to load files and symbols.
+16 −1
Diff settings

Always

Just for now

Next

Fix #55314 - Do not auto-close when ending with open

  • Loading branch information...
MattHardcastle committed Jul 28, 2018
commit 87fb8da7e02c64033214217c9f2bfcb13075f6f6
@@ -121,7 +121,8 @@ export class BracketElectricCharacterSupport {
}
// check if the full open bracket matches
let actual = line.substring(line.length - pair.open.length + 1) + character;
let start = column - pair.open.length;
let actual = line.substring(start, start + pair.open.length) + character;
if (actual !== pair.open) {
continue;
}
@@ -3940,6 +3940,7 @@ suite('autoClosingPairs', () => {
{ open: '{', close: '}' },
{ open: '[', close: ']' },
{ open: '(', close: ')' },
{ open: 'b"', close: '"' },
{ open: '\'', close: '\'', notIn: ['string', 'comment'] },
{ open: '\"', close: '\"', notIn: ['string'] },
{ open: '`', close: '`', notIn: ['string', 'comment'] },
@@ -4070,6 +4071,19 @@ suite('autoClosingPairs', () => {
mode.dispose();
});
test('issue #55314: Do not auto-close when ending with open', () => {
let mode = new AutoClosingMode();
usingCursor({
text: [
'little lamb',
],
languageIdentifier: mode.getLanguageIdentifier()
}, (model, cursor) => {
assertType(model, cursor, 1, 4, '"', '"', `does not double quote when ending with open`);
});
mode.dispose();
});
test('issue #27937: Trying to add an item to the front of a list is cumbersome', () => {
let mode = new AutoClosingMode();
usingCursor({
ProTip! Use n and p to navigate between commits in a pull request.