##// END OF EJS Templates
Backport PR #2554: Avoid stopping in ipdb until we reach the main script....
Backport PR #2554: Avoid stopping in ipdb until we reach the main script. For example: ``` In [1]: %run -d -b 52 setup.py Breakpoint 1 at /tmp/ipython/setup.py:52 NOTE: Enter 'c' at the ipdb> prompt to start your script. > /tmp/ipython/setup.py(7)<module>() 6 Under Windows, the command sdist is not supported, since IPython ----> 7 requires utilities which are not available under Windows.""" 8 ``` compared to the previous behavior: ``` In [1]: %run -d -b 52 setup.py Breakpoint 1 at /tmp/ipython/setup.py:52 NOTE: Enter 'c' at the ipdb> prompt to start your script. > <string>(1)<module>() ``` Closes #1679 ("List command desn't work in ipdb debugger the first time")

File last commit:

r5970:b6bb1663
r9835:45a6e8d3
Show More
runmode.js
27 lines | 968 B | application/javascript | JavascriptLexer
CodeMirror.runMode = function(string, modespec, callback) {
var mode = CodeMirror.getMode({indentUnit: 2}, modespec);
var isNode = callback.nodeType == 1;
if (isNode) {
var node = callback, accum = [];
callback = function(string, style) {
if (string == "\n")
accum.push("<br>");
else if (style)
accum.push("<span class=\"cm-" + CodeMirror.htmlEscape(style) + "\">" + CodeMirror.htmlEscape(string) + "</span>");
else
accum.push(CodeMirror.htmlEscape(string));
}
}
var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode);
for (var i = 0, e = lines.length; i < e; ++i) {
if (i) callback("\n");
var stream = new CodeMirror.StringStream(lines[i]);
while (!stream.eol()) {
var style = mode.token(stream, state);
callback(stream.current(), style, i, stream.start);
stream.start = stream.pos;
}
}
if (isNode)
node.innerHTML = accum.join("");
};