Skip to content

Commit

Permalink
cleanup unnecessary variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ianstormtaylor committed Dec 13, 2019
1 parent e0176a9 commit 3d4b964
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions packages/slate/src/interfaces/editor/transforms/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ export const GeneralTransforms = {
if (selection != null && result != null) {
selection[key] = result
} else {
let found = false
let prev: TextEntry | undefined
let next: TextEntry | undefined

Expand All @@ -191,16 +190,14 @@ export const GeneralTransforms = {
}
}

if (!found) {
if (prev) {
point.path = prev[1]
point.offset = prev[0].text.length
} else if (next) {
point.path = next[1]
point.offset = 0
} else {
selection = null
}
if (prev) {
point.path = prev[1]
point.offset = prev[0].text.length
} else if (next) {
point.path = next[1]
point.offset = 0
} else {
selection = null
}
}
}
Expand Down

0 comments on commit 3d4b964

Please sign in to comment.