@@ -6,7 +6,7 @@ import { getStatistics } from './utils';
66import { type ReactCodeMirrorProps } from '.' ;
77import { TimeoutLatch , getScheduler } from './timeoutLatch' ;
88
9- const External = Annotation . define < boolean > ( ) ;
9+ export const ExternalChange = Annotation . define < boolean > ( ) ;
1010const TYPING_TIMOUT = 200 ; // ms
1111
1212export interface UseCodeMirror extends ReactCodeMirrorProps {
@@ -64,7 +64,7 @@ export function useCodeMirror(props: UseCodeMirror) {
6464 typeof onChange === 'function' &&
6565 // Fix echoing of the remote changes:
6666 // 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 ) )
6868 ) {
6969 if ( typingLatch . current ) {
7070 typingLatch . current . reset ( ) ;
@@ -193,7 +193,7 @@ export function useCodeMirror(props: UseCodeMirror) {
193193 if ( view && value !== view . state . doc . toString ( ) ) {
194194 view . dispatch ( {
195195 changes : { from : 0 , to : view . state . doc . toString ( ) . length , insert : value || '' } ,
196- annotations : [ External . of ( true ) ] ,
196+ annotations : [ ExternalChange . of ( true ) ] ,
197197 } ) ;
198198 }
199199 } ;
0 commit comments