add insertText command

This commit is contained in:
Philipp Kühn
2018-10-02 23:01:53 +02:00
parent 5aa206f09e
commit 4a31f8f1ca
2 changed files with 12 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
export default function (text = '') {
return (state, dispatch) => {
const { $from } = state.selection
const { pos } = $from.pos
dispatch(state.tr.insertText(text, pos))
return true
}
}