Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken $.terminal.substring when text have formatting and brackets #792

Closed
jcubic opened this issue Jun 12, 2022 · 1 comment
Closed

Broken $.terminal.substring when text have formatting and brackets #792

jcubic opened this issue Jun 12, 2022 · 1 comment
Labels
Bug resolved if issue is resolved, it will be open until merge with master

Comments

@jcubic
Copy link
Owner

jcubic commented Jun 12, 2022

Issue summary

Broken typing animation when echoing text that has brackets and formatting

Expected behavior

The whole text should be animated

Actual behavior

Text prints a bug chunk at once

Steps to reproduce

  1. Open Gaiman Playground
  2. Change echo result["def"] with echo* result["def"], 0
@jcubic jcubic added the Bug label Jun 12, 2022
@jcubic jcubic added resolved if issue is resolved, it will be open until merge with master and removed resolved if issue is resolved, it will be open until merge with master labels Jun 12, 2022
@jcubic
Copy link
Owner Author

jcubic commented Jun 15, 2022

The issue is still present. Typing animation was fixed and performance was improved but $.terminal.substring is still broken.

Use case:

function substr(text) {
    var len = $.terminal.length(text);
    var result = [];
    for (var i = 0; i < len; ++i) {
        result.push($.terminal.substring(text, i,i+1));
    }
    return result;
}

var text = '[hello] this is formatting [[;red;]text]';
console.log(substr(text));
/*
[
    "[",
    "h",
    "e",
    "l",
    "l",
    "o] this is formatting [[;red;]text]",
    "",
    " ",
    "t",
    "h",
    "i",
    "s",
    " ",
    "i",
    "s",
    " ",
    "f",
    "o",
    "r",
    "m",
    "a",
    "t",
    "t",
    "i",
    "n",
    "g",
    " ",
    "[[;red;]t]",
    "[[;red;]e]",
    "[[;red;]x]",
    "[[;red;]t]"
]

*/

I was not able to fix the issue, maybe I'm bad with Algo.

@jcubic jcubic changed the title Broken typing animation Broken $.terminal.substring when text have formatting and brackets Jun 15, 2022
@jcubic jcubic added the resolved if issue is resolved, it will be open until merge with master label Jul 10, 2022
@jcubic jcubic closed this as completed Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug resolved if issue is resolved, it will be open until merge with master
Projects
None yet
Development

No branches or pull requests

1 participant