nim-noise icon indicating copy to clipboard operation
nim-noise copied to clipboard

Multiline support?

Open h3rald opened this issue 2 years ago • 2 comments
trafficstars

First of all, good work on this library! One thing confuses me a little bit though: do you really support editing multiple lines?

I tried:

  • Entering text till the end of the line, and when the line wraps the text gets garbled
  • Pressing ENTER or SHIFT+ENTER accepts input

Is there any way to edit multiple lines? How?

h3rald avatar Jul 29 '23 13:07 h3rald

Yes, this library support editing multiple lines. but testing with various terminal is difficult. There might be some terminal that have different behavior.

jangko avatar Jul 29 '23 13:07 jangko

I tried on linux and it seems to support line wrapping, yes.

On windows however, line wrapping doesn't really work: basically it seems to "copy" the previous line and it goes over it.

I was also wondering if this library supports/could support a sort of "new line callback" proc to intercept ENTER key and decide whether to actually print a new line (for example when entering some programming code and the number of parenthesis/delimiters don't match, so that it is possible to have dictionary/arrays entered on multiple lines) or accept input. This would also allow copying and pasting multiple lines into the terminal, and edit the whole text within the same prompt.

What do you think?

h3rald avatar Jul 29 '23 22:07 h3rald