Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/editor/test/common/model/editStack.test.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 { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js';
8
import { Selection } from '../../../common/core/selection.js';
9
import { TextChange } from '../../../common/core/textChange.js';
10
import { EndOfLineSequence } from '../../../common/model.js';
11
import { SingleModelEditStackData } from '../../../common/model/editStack.js';
12
13
suite('EditStack', () => {
14
15
ensureNoDisposablesAreLeakedInTestSuite();
16
17
test('issue #118041: unicode character undo bug', () => {
18
const stackData = new SingleModelEditStackData(
19
1,
20
2,
21
EndOfLineSequence.LF,
22
EndOfLineSequence.LF,
23
[new Selection(10, 2, 10, 2)],
24
[new Selection(10, 1, 10, 1)],
25
[new TextChange(428, '', 428, '')]
26
);
27
28
const buff = stackData.serialize();
29
const actual = SingleModelEditStackData.deserialize(buff);
30
31
assert.deepStrictEqual(actual, stackData);
32
});
33
34
});
35
36