256
257
private static _splitPrev(edit: TextChange, offset: number): [TextChange, TextChange] {
258
>
const preText = edit.newText.substr(0, offset);
textChange.ts
259
>
const postText = edit.newText.substr(offset);
260
>
261
>
return [
262
>
new TextChange(
263
>
edit.oldPosition,
264
>
edit.oldText,
265
>
edit.newPosition,
266
>
preText
267
>
),
268
>
new TextChange(
269
>
edit.oldEnd,
270
>
'',
271
>
edit.newPosition + offset,
272
>
postText
273
>
)
274
>
];
275
>
}
276
277
private static _splitCurr(edit: TextChange, offset: number): [TextChange, TextChange] {