Delete removed lines
This commit is contained in:
parent
5feb4bb93d
commit
a867520b0b
1 changed files with 4 additions and 1 deletions
|
@ -95,6 +95,7 @@ public:
|
||||||
root = two.second;
|
root = two.second;
|
||||||
delete two.first;
|
delete two.first;
|
||||||
}
|
}
|
||||||
|
root = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Line insert
|
// Line insert
|
||||||
|
@ -122,7 +123,9 @@ public:
|
||||||
// Line removal
|
// Line removal
|
||||||
void remove(count_type k) {
|
void remove(count_type k) {
|
||||||
auto two = split(root, k+1);
|
auto two = split(root, k+1);
|
||||||
two.first = split(two.first, k).first;
|
auto first_split = split(two.first, k);
|
||||||
|
delete first_split.second;
|
||||||
|
two.first = first_split.first;
|
||||||
root = join(two);
|
root = join(two);
|
||||||
}
|
}
|
||||||
void pop() {
|
void pop() {
|
||||||
|
|
Loading…
Reference in a new issue