Merge from vscode 91e99652cd5fcfc072387c64e151b435e39e8dcf (#6962)

This commit is contained in:
Anthony Dresser
2019-08-26 15:58:42 -07:00
committed by GitHub
parent edf470c8fa
commit 507bae90b7
103 changed files with 1743 additions and 1543 deletions

View File

@@ -4740,6 +4740,37 @@ suite('autoClosingPairs', () => {
mode.dispose();
});
test('issue #78833 - Add config to use old brackets/quotes overtyping', () => {
let mode = new AutoClosingMode();
usingCursor({
text: [
'',
'y=();'
],
languageIdentifier: mode.getLanguageIdentifier(),
editorOpts: {
autoClosingOvertype: 'always'
}
}, (model, cursor) => {
assertCursor(cursor, new Position(1, 1));
cursorCommand(cursor, H.Type, { text: 'x=(' }, 'keyboard');
assert.strictEqual(model.getLineContent(1), 'x=()');
cursorCommand(cursor, H.Type, { text: ')' }, 'keyboard');
assert.strictEqual(model.getLineContent(1), 'x=()');
cursor.setSelections('test', [new Selection(1, 4, 1, 4)]);
cursorCommand(cursor, H.Type, { text: ')' }, 'keyboard');
assert.strictEqual(model.getLineContent(1), 'x=()');
cursor.setSelections('test', [new Selection(2, 4, 2, 4)]);
cursorCommand(cursor, H.Type, { text: ')' }, 'keyboard');
assert.strictEqual(model.getLineContent(2), 'y=();');
});
mode.dispose();
});
test('issue #15825: accents on mac US intl keyboard', () => {
let mode = new AutoClosingMode();
usingCursor({

View File

@@ -109,9 +109,9 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
[
'<div>',
'<span style="color: #ff0000;font-style: italic;font-weight: bold;">Ciao</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</span>',
'<span style="color: #00ff00;">hello</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</span>',
'<span style="color: #0000ff;text-decoration: underline;">world!</span>',
'</div>'
].join('')
@@ -122,9 +122,9 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
[
'<div>',
'<span style="color: #ff0000;font-style: italic;font-weight: bold;">Ciao</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</span>',
'<span style="color: #00ff00;">hello</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</span>',
'<span style="color: #0000ff;text-decoration: underline;">w</span>',
'</div>'
].join('')
@@ -135,9 +135,9 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
[
'<div>',
'<span style="color: #ff0000;font-style: italic;font-weight: bold;">Ciao</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</span>',
'<span style="color: #00ff00;">hello</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</span>',
'</div>'
].join('')
);
@@ -147,9 +147,9 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
[
'<div>',
'<span style="color: #ff0000;font-style: italic;font-weight: bold;">iao</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</span>',
'<span style="color: #00ff00;">hello</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</span>',
'</div>'
].join('')
);
@@ -158,9 +158,9 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
tokenizeLineToHTML(text, lineTokens, colorMap, 4, 11, 4),
[
'<div>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</span>',
'<span style="color: #00ff00;">hello</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</span>',
'</div>'
].join('')
);
@@ -170,7 +170,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
[
'<div>',
'<span style="color: #00ff00;">hello</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</span>',
'</div>'
].join('')
);
@@ -241,11 +241,11 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
tokenizeLineToHTML(text, lineTokens, colorMap, 0, 21, 4),
[
'<div>',
'<span style="color: #000000;">&nbsp&nbsp</span>',
'<span style="color: #000000;">&nbsp;&nbsp;</span>',
'<span style="color: #ff0000;font-style: italic;font-weight: bold;">Ciao</span>',
'<span style="color: #000000;">&nbsp&nbsp&nbsp</span>',
'<span style="color: #000000;">&nbsp;&nbsp;&nbsp;</span>',
'<span style="color: #00ff00;">hello</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</span>',
'<span style="color: #0000ff;text-decoration: underline;">world!</span>',
'</div>'
].join('')
@@ -255,11 +255,11 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
tokenizeLineToHTML(text, lineTokens, colorMap, 0, 17, 4),
[
'<div>',
'<span style="color: #000000;">&nbsp&nbsp</span>',
'<span style="color: #000000;">&nbsp;&nbsp;</span>',
'<span style="color: #ff0000;font-style: italic;font-weight: bold;">Ciao</span>',
'<span style="color: #000000;">&nbsp&nbsp&nbsp</span>',
'<span style="color: #000000;">&nbsp;&nbsp;&nbsp;</span>',
'<span style="color: #00ff00;">hello</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</span>',
'<span style="color: #0000ff;text-decoration: underline;">wo</span>',
'</div>'
].join('')
@@ -269,7 +269,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
tokenizeLineToHTML(text, lineTokens, colorMap, 0, 3, 4),
[
'<div>',
'<span style="color: #000000;">&nbsp&nbsp</span>',
'<span style="color: #000000;">&nbsp;&nbsp;</span>',
'<span style="color: #ff0000;font-style: italic;font-weight: bold;">C</span>',
'</div>'
].join('')