Skip to content

Commit a1d0112

Browse files
Code editor sizes change fix
1 parent 9a3d3dc commit a1d0112

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "cache-visual-editor",
33
"printableName": "Cache Visual Editor",
44
"packageName": "VisualEditor",
5-
"version": "0.8.0",
5+
"version": "0.8.1",
66
"description": "Visual class editor for InterSystems Caché",
77
"main": "index.js",
88
"keywords": [

source/client/js/classEditor/class/code.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { block, toggle } from "../../domUtils";
22
import { addChange } from "../changes";
33
import { 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

Comments
 (0)