11import { block , toggle } from "../../domUtils" ;
22import { addChange } from "../changes" ;
33import { Toast } from "../../toast" ;
4- import AutoGrid from "../../AutoGrid " ;
4+ import { updateGrid } from "../index " ;
55
66/**
77 * Returns if the method code has routines.
@@ -20,7 +20,7 @@ function switchToRoutineCode (code) {
2020 return code . replace ( / ^ / , "\t" ) . replace ( / \n / g, "\n\t" ) ;
2121}
2222
23- export function getCodeCaptionView ( { manifest , name, data, savePath } ) {
23+ export function getCodeCaptionView ( { name, data, savePath } ) {
2424
2525 let div = block ( `div` , `property-block` ) ,
2626 header = block ( `div` ) ,
@@ -72,11 +72,15 @@ export function getCodeCaptionView ({ manifest, name, data, savePath }) {
7272 maxLines : Infinity
7373 } ) ;
7474
75- editor . on ( `change` , ( ) => { saveChanges ( ) } ) ;
75+ editor . on ( `change` , ( { start, end } ) => {
76+ if ( start . row !== end . row )
77+ setTimeout ( ( ) => updateGrid ( ) , 25 ) ;
78+ saveChanges ( ) ;
79+ } ) ;
7680
7781 div . appendChild ( block ( `hr` ) ) ;
7882 div . appendChild ( header ) ;
79- setTimeout ( ( ) => new AutoGrid ( header ) , 1 ) ;
83+ // setTimeout(() => new AutoGrid(header), 1);
8084 div . appendChild ( editBlock ) ;
8185 editor . resize ( ) ;
8286
0 commit comments