GHC 2019-06-21

3 comments.

, https://git.io/fjwTH in jarun/googler
It's kind of an interesting problem so doesn't hurt to invest some time into it first ;)

, https://git.io/fjwUE in zmwangx/wchardet
@dependabot squash and merge

, https://git.io/fjwUu in jarun/googler
Sorry, got a project going that tied up all my free time for the past few weeks, and this issue is more intricate than a quick half-hour fix. The project is about to conclude, so I’ll probably write a fix tomorrow.

When I gave this issue some passing thought, there are basically three ways forward:
1. Rewrite (expand) the PSL textwrap algorithm, adding support for zero-width and double-width (getting rid of CJK hack at the same time). The algorithm’s complicated as is, so expect some dense code on this path.
2. Use PSL textwrap (along with our CJK hack), but analyze the result to generate a one-to-one, live offset to row:col mapping. Use the mapping to insert characters by offset. This won’t be beautiful, computational complexity will be horrendous in theory but totally acceptable for our hundred-character long strings, and code will probably be mundane and understandable, without too many gotchas.
3. Just forget about hard wrapping, and allow terminals to do what they do — soft wrapping.

My plan is to take route 2, with route 1 as backup. Route 3 is of course welcome if you say the word.