fix chained commands

This commit is contained in:
Philipp Kühn
2020-12-01 14:44:53 +01:00
parent 520b2efee6
commit d8322d2e2e

View File

@@ -141,10 +141,6 @@ export default class CommandManager {
} }
public chainableState(tr: Transaction, state: EditorState): EditorState { public chainableState(tr: Transaction, state: EditorState): EditorState {
let { selection } = tr
let { doc } = tr
let { storedMarks } = tr
return { return {
...state, ...state,
schema: state.schema, schema: state.schema,
@@ -154,19 +150,15 @@ export default class CommandManager {
reconfigure: state.reconfigure.bind(state), reconfigure: state.reconfigure.bind(state),
toJSON: state.toJSON.bind(state), toJSON: state.toJSON.bind(state),
get storedMarks() { get storedMarks() {
return storedMarks return tr.storedMarks
}, },
get selection() { get selection() {
return selection return tr.selection
}, },
get doc() { get doc() {
return doc return tr.doc
}, },
get tr() { get tr() {
selection = tr.selection
doc = tr.doc
storedMarks = tr.storedMarks
return tr return tr
}, },
} }