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

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

Open
michael-ts opened this issue Sep 13, 2024 · 1 comment
Open

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

michael-ts opened this issue Sep 13, 2024 · 1 comment

Comments

@michael-ts
Copy link

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.

@boutell
Copy link
Owner

boutell commented Sep 13, 2024

That's a very cool idea and might help tome get more traction. Will consider! PRs welcome as well.

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

2 participants