Skip to content

Feature request: Make the editor invokable from a function #15

Description

@michael-ts

It would be very useful to be able to embed this as a simple text editor any time I want to enter a multiline input that I can edit before submitting. There are other solutions such as inquirer which spawn an external editor to accomplish this, but it would be more useful in some cases for very simply editing to not need an external process.

I am envisioning something like this:

import { editor } from Tome;

...
const text = await editor({text:"Starting text", // other config options such as setting up key bindings, row/col count, status line, etc. 
})

This function would initialize the editor with the starting text (which could be an empty string) and would return a string containing the final text that the user saved, or false if the user cancelled editing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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