randy3k / radian

A 21 century R console
MIT License
1.96k stars 73 forks source link

only wrap text if the line length > 1000 #389

Closed randy3k closed 1 year ago

randy3k commented 1 year ago

fix #388

A bit of background. To order to fix #379, we have to wrap the input by { and } in order to correctly handle long non-ascii multiline strings. The hack is needed due to R's read console restriction. R is only capable of reading 4096 bytes per line and non-ascii chars cannot be split in middle.

A simple fix for now is to only wrap the input has > 1000 chars and there is a non-ascii text somewhere in the input. A better solution down the road is to detect exactly where the long mutliline strings are and break the strings manually.

renkun-ken commented 1 year ago

Thanks!