Merge pull request #15234 from calixteman/reset_undo_queue
[Editor] Reset the queue when a command is added after having undone all the commands
This commit is contained in:
commit
e515a88faf
@ -108,6 +108,11 @@ class CommandManager {
|
|||||||
|
|
||||||
const save = { cmd, undo, type };
|
const save = { cmd, undo, type };
|
||||||
if (this.#position === -1) {
|
if (this.#position === -1) {
|
||||||
|
if (this.#commands.length > 0) {
|
||||||
|
// All the commands have been undone and then a new one is added
|
||||||
|
// hence we clear the queue.
|
||||||
|
this.#commands.length = 0;
|
||||||
|
}
|
||||||
this.#position = 0;
|
this.#position = 0;
|
||||||
this.#commands.push(save);
|
this.#commands.push(save);
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user