Skip to content

Commit 473e8e1

Browse files
committed
add undocumented 'gopage x' command (useful for debugging)
1 parent d2b277c commit 473e8e1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

resources/public/javascript/tryclojure.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ var pageExitConditions = [
5454

5555
function goToPage(pageNumber) {
5656
if (pageNumber == currentPage || pageNumber < 0 || pageNumber >= pages.length) {
57-
return;
57+
return;
5858
}
5959

6060
currentPage = pageNumber;
@@ -102,6 +102,11 @@ function html_escape(val) {
102102
}
103103

104104
function doCommand(input) {
105+
if (input.match(/^gopage /)) {
106+
goToPage(parseInt(input.substring("gopage ".length)));
107+
return true;
108+
}
109+
105110
switch (input) {
106111
case 'next':
107112
case 'forward':
@@ -146,7 +151,7 @@ function onHandle(line, report) {
146151

147152
// handle page
148153
if (currentPage >= 0 && pageExitConditions[currentPage].verify(data)) {
149-
nextPage();
154+
goToPage(currentPage + 1);
150155
}
151156

152157
// display expr results

0 commit comments

Comments
 (0)