keegandonley/input-deno

[Feature Request] Single-Line and/or Multi-Line input editing.

Opened this issue · 1 comments

When asking a question(), and typing in an answer, if one needs to go back and edit something already written (For example, when writing a parentheses pair, then trying to add text inside said parentheses), it would be useful to be able to use the arrow keys to go back in the string, without needing to delete the text already written.

A system similar to Deno's REPL would be desirable, and perhaps an option for multiline editing could be attempted, again, not unlike the Deno REPL.

Such a multiline system could, when a return is inputted, report back to the program with the currently written lines and current position of the cursor, and let the program decide whether to terminate input or continue, much like the Deno REPL. (That decides not to end input when braces are not closed). The user could then use the arrow keys not only to move left or right within the input, but also up and down. Another feature could be to allow the program to insert characters into the input when this choice is provided (which could allow for automatic indentation).

In any case, just the ability to seek back and forth within a single line is already pretty powerful, and I understand if this project decides it might not be wise to implement multiline editing.

@AZMCode This is a great idea and certainly something that would be useful. I'll go down the road of seeking/editing within single lines of input first, but multi-line input would be interesting to investigate as well.