1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-09-02 19:52:32 +02:00
This commit is contained in:
Ian Storm Taylor
2019-11-30 01:40:01 -05:00
parent 6bbecb1a9c
commit 76afb00631
2 changed files with 3 additions and 8 deletions

View File

@@ -358,8 +358,8 @@ export const LocationQueries = {
pass: ([n]) => Element.isElement(n) && editor.isVoid(n),
})
let universalMarks: Mark[] = []
let distinctMarks: Mark[] = []
const universalMarks: Mark[] = []
const distinctMarks: Mark[] = []
let universalEntries: MarkEntry[] = []
let first = true
@@ -372,10 +372,8 @@ export const LocationQueries = {
return Mark.matches(entry[0], m)
}
}
debugger
if (mode === 'universal') {
debugger
if (first) {
universalMarks.push(...node.marks)
universalEntries = node.marks.map((m, i) => [m, i, node, path])
@@ -386,11 +384,9 @@ export const LocationQueries = {
// PERF: If we're in universal mode and the eligible marks hits zero
// it can never increase again, so we can exit early.
if (universalMarks.length === 0) {
debugger
return
}
debugger
for (let i = universalMarks.length - 1; i >= 0; i--) {
const existing = universalMarks[i]
@@ -428,7 +424,6 @@ export const LocationQueries = {
// In universal mode, the marks are collected while iterating and we can
// only be certain of which are universal when we've finished.
if (mode === 'universal') {
debugger
yield* universalEntries
}
},