diff --git a/package.json b/package.json index 1d0bbf61..10607edf 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "author": "Steven Hugg", "dependencies": {}, "devDependencies": { + "typescript": "^2.9.2", "@types/jquery": "^3.3.4", "mocha": "^3.2.0", "mocha-phantomjs": "^4.1.0", diff --git a/src/ui.js b/src/ui.js index 34822c9d..8eeadf73 100644 --- a/src/ui.js +++ b/src/ui.js @@ -501,12 +501,6 @@ function clearBreakpoint() { showMemory(); } -function jumpToLine(ed, i) { - var t = ed.charCoords({line: i, ch: 0}, "local").top; - var middleHeight = ed.getScrollerElement().offsetHeight / 2; - ed.scrollTo(null, t - middleHeight - 5); -} - function resetAndDebug() { if (platform.setupDebug && platform.readAddress) { // TODO?? clearBreakpoint(); diff --git a/src/views.ts b/src/views.ts index 0226dece..cf819ab8 100644 --- a/src/views.ts +++ b/src/views.ts @@ -13,7 +13,12 @@ var pixeditframe; // TODO: functions var inspectVariable; -var jumpToLine; + +function jumpToLine(ed, i:number) { + var t = ed.charCoords({line: i, ch: 0}, "local").top; + var middleHeight = ed.getScrollerElement().offsetHeight / 2; + ed.scrollTo(null, t - middleHeight - 5); +} // TODO: remove some calls of global functions function SourceEditor(path, mode) {