1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-07-31 04:20:26 +02:00

Fix insert-text benchmark

This commit is contained in:
Soreine
2016-10-28 12:34:12 +02:00
parent 2a6fc88bfe
commit 6d88672e83
2 changed files with 7 additions and 3 deletions

View File

@@ -3,8 +3,12 @@ module.exports = {
setup(state) { setup(state) {
// Move cursor // Move cursor
return state.transform() return state.transform()
.collapseToStartOf({ key: '_cursor_' }) .moveTo({
.moveForward(10) // Move inside the text anchorKey: '_cursor_',
anchorOffset: 10,
focusKey: '_cursor_',
focusOffset: 10
})
.apply() .apply()
}, },

View File

@@ -18,10 +18,10 @@ nodes:
- type: code - type: code
- text: '!' - text: '!'
- kind: block - kind: block
key: _cursor_
type: paragraph type: paragraph
nodes: nodes:
- kind: text - kind: text
key: _cursor_
ranges: ranges:
- text: 'Since it''s rich text, you can do things like turn a selection of text ' - text: 'Since it''s rich text, you can do things like turn a selection of text '
- text: 'bold' - text: 'bold'