mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-18 13:11:17 +02:00
Rename extend...Offset
to move...Offset
This commit is contained in:
@@ -576,7 +576,7 @@ class Selection extends new Record(DEFAULTS) {
|
||||
* @return {Selection} selection
|
||||
*/
|
||||
|
||||
extendStartOffset(n = 1) {
|
||||
moveStartOffset(n = 1) {
|
||||
return this.isBackward
|
||||
? this.merge({ focusOffset: this.focusOffset + n })
|
||||
: this.merge({ anchorOffset: this.anchorOffset + n })
|
||||
@@ -589,7 +589,7 @@ class Selection extends new Record(DEFAULTS) {
|
||||
* @return {Selection} selection
|
||||
*/
|
||||
|
||||
extendEndOffset(n = 1) {
|
||||
moveEndOffset(n = 1) {
|
||||
return this.isBackward
|
||||
? this.merge({ anchorOffset: this.anchorOffset + n })
|
||||
: this.merge({ focusOffset: this.focusOffset + n })
|
||||
|
@@ -116,10 +116,10 @@ function insertText(state, operation) {
|
||||
|
||||
// Update the selection
|
||||
if (startKey == node.key && startOffset > offset) {
|
||||
selection = selection.extendStartOffset(text.length)
|
||||
selection = selection.moveStartOffset(text.length)
|
||||
}
|
||||
if (endKey == node.key && endOffset > offset) {
|
||||
selection = selection.extendEndOffset(text.length)
|
||||
selection = selection.moveEndOffset(text.length)
|
||||
}
|
||||
|
||||
state = state.merge({ document, selection })
|
||||
|
Reference in New Issue
Block a user