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

edit-line command return multiple lines instead of one #66

Open
Alex100dre opened this issue Jan 20, 2019 · 3 comments
Open

edit-line command return multiple lines instead of one #66

Alex100dre opened this issue Jan 20, 2019 · 3 comments

Comments

@Alex100dre
Copy link

Hello, thanks for this awesome component 🙂

I tried to implement the type-text from advanced commands examples which use the edit-line built in command that is supposed to edit the last line.

commands={{
  'type-text': (args, print, runCommand) => {
    const text = args.slice(1).join(' ')
    print('')
    for (let i = 0; i < text.length; i += 1) {
      setTimeout(() => {
        runCommand(`edit-line ${text.slice(0, i + 1)}`)
      }, 100 * i)
    }
  },
}}

But instead of getting the last line updating, it return a new line at each iteration.

> type-text hello
 
h
he
hel
hell
hello

Any idea of what could cause this? 🤔

@JustinMartinDev
Copy link

@Alex100dre i got the same issue did you fix it ?

@Alex100dre
Copy link
Author

Sadly not. I didn't spent time on it for the moment.

Let me know if you find something.

I'll do the same on my side.

@HugoLiconV
Copy link

any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants