File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
+ import { isEqual } from 'lodash' ;
2
3
3
4
import { CommonEditorProps , Position , Selection } from '../types' ;
4
5
@@ -80,7 +81,7 @@ class SimpleEditor extends React.PureComponent<CommonEditorProps> {
80
81
const editor = this . _editor ;
81
82
82
83
if ( ! newPosition || ! editor ) { return ; }
83
- if ( newPosition === oldPosition ) { return ; }
84
+ if ( isEqual ( newPosition , oldPosition ) ) { return ; }
84
85
85
86
const offsets = new CodeByteOffsets ( this . props . code ) ;
86
87
const [ startBytes , endBytes ] = offsets . lineToOffsets ( newPosition . line ) ;
@@ -93,7 +94,7 @@ class SimpleEditor extends React.PureComponent<CommonEditorProps> {
93
94
const editor = this . _editor ;
94
95
95
96
if ( ! newSelection || ! newSelection . start || ! newSelection . end || ! editor ) { return ; }
96
- if ( newSelection === oldSelection ) { return ; }
97
+ if ( isEqual ( newSelection , oldSelection ) ) { return ; }
97
98
98
99
const offsets = new CodeByteOffsets ( this . props . code ) ;
99
100
const [ startBytes , endBytes ] = offsets . rangeToOffsets ( newSelection . start , newSelection . end ) ;
You can’t perform that action at this time.
0 commit comments