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.
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
inquirerwhich 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:
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
falseif the user cancelled editing.