Skip to content

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

@Alex100dre

Description

@Alex100dre

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? 🤔

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions