@@ -6,7 +6,7 @@ import { getStatistics } from './utils';
6
6
import { type ReactCodeMirrorProps } from '.' ;
7
7
import { TimeoutLatch , getScheduler } from './timeoutLatch' ;
8
8
9
- const External = Annotation . define < boolean > ( ) ;
9
+ export const ExternalChange = Annotation . define < boolean > ( ) ;
10
10
const TYPING_TIMOUT = 200 ; // ms
11
11
12
12
export interface UseCodeMirror extends ReactCodeMirrorProps {
@@ -64,7 +64,7 @@ export function useCodeMirror(props: UseCodeMirror) {
64
64
typeof onChange === 'function' &&
65
65
// Fix echoing of the remote changes:
66
66
// If transaction is market as remote we don't have to call `onChange` handler again
67
- ! vu . transactions . some ( ( tr ) => tr . annotation ( External ) )
67
+ ! vu . transactions . some ( ( tr ) => tr . annotation ( ExternalChange ) )
68
68
) {
69
69
if ( typingLatch . current ) {
70
70
typingLatch . current . reset ( ) ;
@@ -193,7 +193,7 @@ export function useCodeMirror(props: UseCodeMirror) {
193
193
if ( view && value !== view . state . doc . toString ( ) ) {
194
194
view . dispatch ( {
195
195
changes : { from : 0 , to : view . state . doc . toString ( ) . length , insert : value || '' } ,
196
- annotations : [ External . of ( true ) ] ,
196
+ annotations : [ ExternalChange . of ( true ) ] ,
197
197
} ) ;
198
198
}
199
199
} ;
0 commit comments