summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAleš Smodiš <aless@guru.si>2015-09-17 14:57:42 +0200
committerAleš Smodiš <aless@guru.si>2015-09-17 14:57:42 +0200
commitebd7224135e2b283ff6cc58c5a54c4aaca378a0a (patch)
tree8751b353d190c1fe574f9f0006f751d4acc4df97 /js
parent6ac071053a9c8c77d796875c0e84871d6e71f75b (diff)
Minor bugfix in prolog mode terminal: don't add an additional full-stop on manual stop of browsing through answers.
Diffstat (limited to 'js')
-rw-r--r--js/prolog.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/js/prolog.js b/js/prolog.js
index 2868830..085860c 100644
--- a/js/prolog.js
+++ b/js/prolog.js
@@ -8,6 +8,7 @@
var makePrologTerminalHandler = function (jqConsole, editor, problem_id, activityHandler) {
var promptMode = true, // default: query composition; alternative: query result browsing
+ manualStop = false, // if the user stopped showing next answers (false) or if there are no more answers (true)
terminal = codeq.makeConsole(jqConsole, {
'greeting': 'CodeQ Prolog terminal proxy'
}),
@@ -24,7 +25,7 @@
}
if (promptMode) {
terminal.setLineBuffered();
- terminal.append('.\n?- ', 'output');
+ terminal.append(manualStop ? '?- ' : '.\n?- ', 'output');
}
},
tcf = function terminalCommandFailed (error) {
@@ -49,6 +50,7 @@
terminal.onInput = function (command) {
if (promptMode) {
promptMode = false;
+ manualStop = false;
terminal.setNotBuffered();
return codeq.comms.sendQuery({
'problem_id': problem_id,
@@ -70,6 +72,7 @@
}
else {
// stop searching for answers
+ manualStop = true;
return codeq.comms.sendQuery({
'problem_id': problem_id,
'step': 'end',