Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
return editor.moveForward()
}
if (Hotkeys.isMoveWordBackward(event)) {
event.preventDefault()
return editor.moveWordBackward()
}
if (Hotkeys.isMoveWordForward(event)) {
event.preventDefault()
return editor.moveWordForward()
}
if (Hotkeys.isExtendBackward(event)) {
const startText = document.getNode(start.path)
const [prevEntry] = document.texts({
path: start.path,
direction: 'backward',
})
let isPrevInVoid = false
if (prevEntry) {
const [, prevPath] = prevEntry
isPrevInVoid = document.hasVoidParent(prevPath, editor)
}
if (hasVoidParent || isPrevInVoid || startText.text === '') {
event.preventDefault()
return editor.moveFocusBackward()