Skip to content

Commit 87d7a2b

Browse files
committed
actual fix for blank lines typing animation #946
1 parent b1d28d9 commit 87d7a2b

File tree

7 files changed

+64
-48
lines changed

7 files changed

+64
-48
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.42.2
2+
### Bugfix
3+
* actual fix for blank lines typing animation [#946](https://github.com/jcubic/jquery.terminal/issues/946)
4+
15
## 2.42.1
26
### Bugfix
37
* fix line wrapping when calling multiple echo `newline:false` [#952](https://github.com/jcubic/jquery.terminal/issues/952)

js/jquery.terminal-2.42.1.js

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*
4242
* broken image by Sophia Bai from the Noun Project (CC-BY)
4343
*
44-
* Date: Tue, 09 Jul 2024 17:29:23 +0000
44+
* Date: Fri, 12 Jul 2024 11:45:14 +0000
4545
*/
4646
/* global define, Map, BigInt */
4747
/* eslint-disable */
@@ -5312,7 +5312,7 @@
53125312
// -------------------------------------------------------------------------
53135313
$.terminal = {
53145314
version: '2.42.1',
5315-
date: 'Tue, 09 Jul 2024 17:29:23 +0000',
5315+
date: 'Fri, 12 Jul 2024 11:45:14 +0000',
53165316
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
53175317
color_names: [
53185318
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
@@ -9271,21 +9271,25 @@
92719271
input_chars = chars;
92729272
input_len = len;
92739273
}
9274-
var chr = input_chars[char_i];
9275-
if (options.mask) {
9276-
var mask = command_line.mask();
9277-
if (typeof mask === 'string') {
9278-
chr = mask;
9279-
} else if (mask) {
9280-
chr = settings.maskChar;
9274+
if (input_len === 0) {
9275+
command_line.prompt('');
9276+
} else {
9277+
var chr = input_chars[char_i];
9278+
if (options.mask) {
9279+
var mask = command_line.mask();
9280+
if (typeof mask === 'string') {
9281+
chr = mask;
9282+
} else if (mask) {
9283+
chr = settings.maskChar;
9284+
}
92819285
}
9286+
new_prompt += chr;
9287+
command_line.prompt(new_prompt, {formatters: false});
9288+
if (bottom && (chr === '\n' || !self.is_bottom())) {
9289+
self.scroll_to_bottom();
9290+
}
9291+
char_i++;
92829292
}
9283-
new_prompt += chr;
9284-
command_line.prompt(new_prompt, {formatters: false});
9285-
if (bottom && (chr === '\n' || !self.is_bottom())) {
9286-
self.scroll_to_bottom();
9287-
}
9288-
char_i++;
92899293
if (char_i === input_len && optimized) {
92909294
var index = self.last_index();
92919295
if (line === anim_lines.length - 1) {

js/jquery.terminal-2.42.1.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: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9271,21 +9271,25 @@
92719271
input_chars = chars;
92729272
input_len = len;
92739273
}
9274-
var chr = input_chars[char_i];
9275-
if (options.mask) {
9276-
var mask = command_line.mask();
9277-
if (typeof mask === 'string') {
9278-
chr = mask;
9279-
} else if (mask) {
9280-
chr = settings.maskChar;
9274+
if (input_len === 0) {
9275+
command_line.prompt('');
9276+
} else {
9277+
var chr = input_chars[char_i];
9278+
if (options.mask) {
9279+
var mask = command_line.mask();
9280+
if (typeof mask === 'string') {
9281+
chr = mask;
9282+
} else if (mask) {
9283+
chr = settings.maskChar;
9284+
}
92819285
}
9286+
new_prompt += chr;
9287+
command_line.prompt(new_prompt, {formatters: false});
9288+
if (bottom && (chr === '\n' || !self.is_bottom())) {
9289+
self.scroll_to_bottom();
9290+
}
9291+
char_i++;
92829292
}
9283-
new_prompt += chr;
9284-
command_line.prompt(new_prompt, {formatters: false});
9285-
if (bottom && (chr === '\n' || !self.is_bottom())) {
9286-
self.scroll_to_bottom();
9287-
}
9288-
char_i++;
92899293
if (char_i === input_len && optimized) {
92909294
var index = self.last_index();
92919295
if (line === anim_lines.length - 1) {

js/jquery.terminal.js

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*
4242
* broken image by Sophia Bai from the Noun Project (CC-BY)
4343
*
44-
* Date: Tue, 09 Jul 2024 17:29:23 +0000
44+
* Date: Fri, 12 Jul 2024 11:45:14 +0000
4545
*/
4646
/* global define, Map, BigInt */
4747
/* eslint-disable */
@@ -5312,7 +5312,7 @@
53125312
// -------------------------------------------------------------------------
53135313
$.terminal = {
53145314
version: '2.42.1',
5315-
date: 'Tue, 09 Jul 2024 17:29:23 +0000',
5315+
date: 'Fri, 12 Jul 2024 11:45:14 +0000',
53165316
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
53175317
color_names: [
53185318
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
@@ -9271,21 +9271,25 @@
92719271
input_chars = chars;
92729272
input_len = len;
92739273
}
9274-
var chr = input_chars[char_i];
9275-
if (options.mask) {
9276-
var mask = command_line.mask();
9277-
if (typeof mask === 'string') {
9278-
chr = mask;
9279-
} else if (mask) {
9280-
chr = settings.maskChar;
9274+
if (input_len === 0) {
9275+
command_line.prompt('');
9276+
} else {
9277+
var chr = input_chars[char_i];
9278+
if (options.mask) {
9279+
var mask = command_line.mask();
9280+
if (typeof mask === 'string') {
9281+
chr = mask;
9282+
} else if (mask) {
9283+
chr = settings.maskChar;
9284+
}
92819285
}
9286+
new_prompt += chr;
9287+
command_line.prompt(new_prompt, {formatters: false});
9288+
if (bottom && (chr === '\n' || !self.is_bottom())) {
9289+
self.scroll_to_bottom();
9290+
}
9291+
char_i++;
92829292
}
9283-
new_prompt += chr;
9284-
command_line.prompt(new_prompt, {formatters: false});
9285-
if (bottom && (chr === '\n' || !self.is_bottom())) {
9286-
self.scroll_to_bottom();
9287-
}
9288-
char_i++;
92899293
if (char_i === input_len && optimized) {
92909294
var index = self.last_index();
92919295
if (line === anim_lines.length - 1) {

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.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)