mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-28 09:29:49 +02:00
Fix certain undos undoing more than they should (#5866)
* prevent false positives for history batch merging * add changeset
This commit is contained in:
5
.changeset/friendly-socks-divide.md
Normal file
5
.changeset/friendly-socks-divide.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'slate-history': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix certain undos undoing more than they should
|
@@ -83,7 +83,7 @@ export const withHistory = <T extends Editor>(editor: T) => {
|
|||||||
if (merge == null) {
|
if (merge == null) {
|
||||||
if (lastBatch == null) {
|
if (lastBatch == null) {
|
||||||
merge = false
|
merge = false
|
||||||
} else if (operations.length !== 0) {
|
} else if (operations.includes(lastOp)) {
|
||||||
merge = true
|
merge = true
|
||||||
} else {
|
} else {
|
||||||
merge = shouldMerge(op, lastOp)
|
merge = shouldMerge(op, lastOp)
|
||||||
|
Reference in New Issue
Block a user