Skip to content

Commit 943f72c

Browse files
committed
1 parent e45fd26 commit 943f72c

File tree

4 files changed

+27
-19
lines changed

4 files changed

+27
-19
lines changed

js/jquery.terminal-0.9.2.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
* Copyright (c) 2007-2013 Alexandru Marasteanu <hello at alexei dot ro>
4545
* licensed under 3 clause BSD license
4646
*
47-
* Date: Tue, 22 Dec 2015 16:17:03 +0000
47+
* Date: Tue, 22 Dec 2015 18:55:36 +0000
4848
*/
4949

5050
/* TODO:
@@ -3101,22 +3101,26 @@
31013101
var string = $.type(line) === "function" ? line() : line;
31023102
string = $.type(string) === "string" ? string : String(string);
31033103
if (string !== '') {
3104-
$.each(string.split(format_exec_re), function(i, string) {
3105-
if (string.match(format_exec_re)) {
3104+
if (line_settings.exec) {
3105+
string = $.map(string.split(format_exec_re), function(string) {
3106+
if (string.match(format_exec_re)) {
31063107
// redraw should not execute commands and it have
31073108
// and lines variable have all extended commands
3108-
if (line_settings.exec) {
31093109
string = string.replace(/^\[\[|\]\]$/g, '');
31103110
if (prev_command && prev_command.command == string) {
31113111
self.error(strings.recursiveCall);
31123112
} else {
31133113
$.terminal.extended_command(self, string);
31143114
}
3115+
return '';
3116+
} else {
3117+
return string;
31153118
}
3116-
} else if (string !== '') {
3117-
buffer_line(string, line_settings);
3118-
}
3119-
});
3119+
}).join('');
3120+
buffer_line(string, line_settings);
3121+
} else {
3122+
buffer_line(string, line_settings);
3123+
}
31203124
}
31213125
} catch (e) {
31223126
output_buffer = [];

js/jquery.terminal-0.9.2.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/jquery.terminal-min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/jquery.terminal-src.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3101,22 +3101,26 @@
31013101
var string = $.type(line) === "function" ? line() : line;
31023102
string = $.type(string) === "string" ? string : String(string);
31033103
if (string !== '') {
3104-
$.each(string.split(format_exec_re), function(i, string) {
3105-
if (string.match(format_exec_re)) {
3104+
if (line_settings.exec) {
3105+
string = $.map(string.split(format_exec_re), function(string) {
3106+
if (string.match(format_exec_re)) {
31063107
// redraw should not execute commands and it have
31073108
// and lines variable have all extended commands
3108-
if (line_settings.exec) {
31093109
string = string.replace(/^\[\[|\]\]$/g, '');
31103110
if (prev_command && prev_command.command == string) {
31113111
self.error(strings.recursiveCall);
31123112
} else {
31133113
$.terminal.extended_command(self, string);
31143114
}
3115+
return '';
3116+
} else {
3117+
return string;
31153118
}
3116-
} else if (string !== '') {
3117-
buffer_line(string, line_settings);
3118-
}
3119-
});
3119+
}).join('');
3120+
buffer_line(string, line_settings);
3121+
} else {
3122+
buffer_line(string, line_settings);
3123+
}
31203124
}
31213125
} catch (e) {
31223126
output_buffer = [];

0 commit comments

Comments
 (0)