Skip to content

Commit

Permalink
fix visible prompt during multiline typing animation #934
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Apr 27, 2024
1 parent 36e85b7 commit e1fdf4b
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## 2.40.5
### Bugfix
* fix visible prompt during multiline typing animation [#934](https://github.com/jcubic/jquery.terminal/issues/934)

## 2.40.4
### Bugfix
* fix flash of old dynamic prompt on enter [#926](https://github.com/jcubic/jquery.terminal/issues/926)
Expand Down
15 changes: 10 additions & 5 deletions js/jquery.terminal-2.40.4.js
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Fri, 26 Apr 2024 22:28:43 +0000
* Date: Sat, 27 Apr 2024 14:21:29 +0000
*/
/* global define, Map, BigInt */
/* eslint-disable */
Expand Down Expand Up @@ -5310,7 +5310,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: '2.40.4',
date: 'Fri, 26 Apr 2024 22:28:43 +0000',
date: 'Sat, 27 Apr 2024 14:21:29 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -9241,9 +9241,14 @@
}
char_i++;
if (char_i === input_len && optimized) {
// swap prompt with line
var index = self.last_index();
self.set_prompt(prompt);
if (line === anim_lines.length - 1) {
// swap prompt with line
self.set_prompt(prompt);
} else {
// clear prompt for multiline string #934
self.set_prompt('');
}
var is_partial = !!lines.get_partial().length;
self.echo(formatted_line, $.extend({}, options, {
formatters: false,
Expand Down Expand Up @@ -9271,7 +9276,7 @@
clearInterval(interval);
setTimeout(function() {
if (is_partial || options.newline === false) {
// HACK: fix sequance of animations #930
// HACK: fix sequence of animations #930
var idx = self.last_index();
var node = output.find('[data-index="' + idx + '"]');
options.finalize(node);
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal-2.40.4.min.js

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions js/jquery.terminal-src.js
Expand Up @@ -9241,9 +9241,14 @@
}
char_i++;
if (char_i === input_len && optimized) {
// swap prompt with line
var index = self.last_index();
self.set_prompt(prompt);
if (line === anim_lines.length - 1) {
// swap prompt with line
self.set_prompt(prompt);
} else {
// clear prompt for multiline string #934
self.set_prompt('');
}
var is_partial = !!lines.get_partial().length;
self.echo(formatted_line, $.extend({}, options, {
formatters: false,
Expand Down Expand Up @@ -9271,7 +9276,7 @@
clearInterval(interval);
setTimeout(function() {
if (is_partial || options.newline === false) {
// HACK: fix sequance of animations #930
// HACK: fix sequence of animations #930
var idx = self.last_index();
var node = output.find('[data-index="' + idx + '"]');
options.finalize(node);
Expand Down
15 changes: 10 additions & 5 deletions js/jquery.terminal.js
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Fri, 26 Apr 2024 22:28:43 +0000
* Date: Sat, 27 Apr 2024 14:21:29 +0000
*/
/* global define, Map, BigInt */
/* eslint-disable */
Expand Down Expand Up @@ -5310,7 +5310,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: '2.40.4',
date: 'Fri, 26 Apr 2024 22:28:43 +0000',
date: 'Sat, 27 Apr 2024 14:21:29 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -9241,9 +9241,14 @@
}
char_i++;
if (char_i === input_len && optimized) {
// swap prompt with line
var index = self.last_index();
self.set_prompt(prompt);
if (line === anim_lines.length - 1) {
// swap prompt with line
self.set_prompt(prompt);
} else {
// clear prompt for multiline string #934
self.set_prompt('');
}
var is_partial = !!lines.get_partial().length;
self.echo(formatted_line, $.extend({}, options, {
formatters: false,
Expand Down Expand Up @@ -9271,7 +9276,7 @@
clearInterval(interval);
setTimeout(function() {
if (is_partial || options.newline === false) {
// HACK: fix sequance of animations #930
// HACK: fix sequence of animations #930
var idx = self.last_index();
var node = output.find('[data-index="' + idx + '"]');
options.finalize(node);
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/jquery.terminal.min.js.map

Large diffs are not rendered by default.

0 comments on commit e1fdf4b

Please sign in to comment.