refactoring

This commit is contained in:
Philipp Kühn
2021-06-04 00:05:24 +02:00
parent 53d7172ff1
commit 478237dc61

View File

@@ -105,7 +105,10 @@ export const Figure = Node.create<FigureOptions>({
})
// set cursor at end of caption field
.command(({ tr, commands }) => {
return commands.setTextSelection(tr.doc.resolve(tr.selection.to - 2).end())
const { doc, selection } = tr
const position = doc.resolve(selection.to - 2).end()
return commands.setTextSelection(position)
})
.run()
},