Skip to content

Commit 1ab3f2a

Browse files
committed
debugger tooltips don't now overwrite code you might be typing on LHS, and url handler now handles 'codeurl' to get code from a URL and display it
1 parent fd9fe18 commit 1ab3f2a

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

Diff for: EspruinoTools

Diff for: js/plugins/debugger.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@
126126
}
127127

128128
function onEditorHover(info, callback) {
129-
if (inDebugMode && !callbackOnEqualsLine) {
129+
if (inDebugMode && // in debug mode
130+
!callbackOnEqualsLine && // we're not trying to do something already
131+
Espruino.Core.Terminal.getTerminalLine()=="debug>" // user is not currently typing on LHS
132+
) {
130133
var name;
131134
if (info.node.className=="cm-variable" ||
132135
info.node.className=="cm-def") {
@@ -215,4 +218,4 @@
215218
Espruino.Plugins.Debugger = {
216219
init : init,
217220
};
218-
}());
221+
}());

Diff for: js/plugins/urlHandler.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@
2222
case "code":
2323
Espruino.Core.EditorJavaScript.setCode(val);
2424
break;
25+
case "codeurl":
26+
Espruino.Core.EditorJavaScript.setCode("Loading from "+val+"...");
27+
$.get(val, function(data){
28+
Espruino.Core.EditorJavaScript.setCode(data);
29+
}).error(function(){
30+
Espruino.Core.EditorJavaScript.setCode("ERROR");
31+
});
32+
break;
2533
case "upload":
2634
Espruino.Core.MenuPortSelector.ensureConnected(function() {
2735
Espruino.Core.Terminal.focus(); // give the terminal focus
@@ -69,4 +77,4 @@
6977

7078
handle : handle, // handle a URL
7179
};
72-
}());
80+
}());

0 commit comments

Comments
 (0)