Skip to content

Commit dee5628

Browse files
committed
minor
1 parent 3dfc4e0 commit dee5628

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

‎v3/js/opt-live.js‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3636

3737
/* TODOs:
3838
39-
- [later] detect exact position of syntax error and put a squiggly line below
40-
it with something like:
41-
42-
File "<string>", line 1
43-
x~=1
44-
^
4539
- make Ace editor resizable width-wise using jQuery resizable
4640
(stackoverflow has some tips for how to do that)
4741
- users want this!
@@ -54,6 +48,15 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5448
- [later] add a codeopticon-style history slider of the user's past
5549
edits (but that might be confusing)
5650
51+
- [later] detect exact position of syntax error and put a squiggly line below
52+
it with something like:
53+
54+
File "<string>", line 1
55+
x~=1
56+
^
57+
58+
(do this for the OPT classic editor too. and for other language backends)
59+
5760
*/
5861

5962

‎v3/js/pytutor.js‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,14 @@ ExecutionVisualizer.prototype.render = function() {
782782
this.params.startingInstruction--;
783783
}
784784

785+
// fail-soft with out-of-bounds startingInstruction values:
786+
if (this.params.startingInstruction < 0) {
787+
this.params.startingInstruction = 0;
788+
}
789+
if (this.params.startingInstruction >= this.curTrace.length) {
790+
this.params.startingInstruction = this.curTrace.length - 1;
791+
}
792+
785793
assert(0 <= this.params.startingInstruction &&
786794
this.params.startingInstruction < this.curTrace.length);
787795
this.curInstr = this.params.startingInstruction;

0 commit comments

Comments
 (0)