Changeset: Remove unnecessary `linesApplySplice()`
parent
37bb297e76
commit
7ec0d5f385
|
@ -654,15 +654,6 @@ const textLinesMutator = (lines) => {
|
||||||
// invariant: if (inSplice && (curLine >= curSplice[0] + curSplice.length - 2)) then
|
// invariant: if (inSplice && (curLine >= curSplice[0] + curSplice.length - 2)) then
|
||||||
// curCol == 0
|
// curCol == 0
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds and/or removes entries at a specific offset in `lines`. Called when leaving the splice.
|
|
||||||
*
|
|
||||||
* @param {[number, number?, ...string[]?]} s - curSplice
|
|
||||||
*/
|
|
||||||
const linesApplySplice = (s) => {
|
|
||||||
lines.splice(...s);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a line from `lines` at given index.
|
* Get a line from `lines` at given index.
|
||||||
*
|
*
|
||||||
|
@ -724,7 +715,7 @@ const textLinesMutator = (lines) => {
|
||||||
* close or TODO(doc).
|
* close or TODO(doc).
|
||||||
*/
|
*/
|
||||||
const leaveSplice = () => {
|
const leaveSplice = () => {
|
||||||
linesApplySplice(curSplice);
|
lines.splice(...curSplice);
|
||||||
curSplice.length = 2;
|
curSplice.length = 2;
|
||||||
curSplice[0] = curSplice[1] = 0;
|
curSplice[0] = curSplice[1] = 0;
|
||||||
inSplice = false;
|
inSplice = false;
|
||||||
|
|
Loading…
Reference in New Issue