Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/editor/test/browser/controller/cursor.integrationTest.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import assert from 'assert';
7
import { Selection } from '../../../common/core/selection.js';
8
import { withTestCodeEditor } from '../testCodeEditor.js';
9
10
suite('Editor Controller', () => {
11
12
test('issue #23913: Greater than 1000+ multi cursor typing replacement text appears inverted, lines begin to drop off selection', function () {
13
this.timeout(10000);
14
const LINE_CNT = 2000;
15
16
const text: string[] = [];
17
for (let i = 0; i < LINE_CNT; i++) {
18
text[i] = 'asd';
19
}
20
21
withTestCodeEditor(text, {}, (editor, viewModel) => {
22
const model = editor.getModel();
23
24
const selections: Selection[] = [];
25
for (let i = 0; i < LINE_CNT; i++) {
26
selections[i] = new Selection(i + 1, 1, i + 1, 1);
27
}
28
viewModel.setSelections('test', selections);
29
30
viewModel.type('n', 'keyboard');
31
viewModel.type('n', 'keyboard');
32
33
for (let i = 0; i < LINE_CNT; i++) {
34
assert.strictEqual(model.getLineContent(i + 1), 'nnasd', 'line #' + (i + 1));
35
}
36
37
assert.strictEqual(viewModel.getSelections().length, LINE_CNT);
38
assert.strictEqual(viewModel.getSelections()[LINE_CNT - 1].startLineNumber, LINE_CNT);
39
});
40
});
41
});
42
43