-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
In the later 0.1.* versions of unicode-width, they had changed newlines to have a width of 1, rather than 0. This messed up rendering for us (#10950). In the meantime we pinned the version to =0.1.12 (though for this I believe skipping 0.1.13 and using 0.1.14 would also work for us).
Since then, in the 0.2.* versions, there have been enhancements to the correct width of characters, for example in the TODO:
0.1.12:

I believe it is worth it to try to refactor whats needed so that we can upgrade to take advantage of some of the improvements that have come since then.
This was attempted initially in #10962, but the decision was made to ultimately just pin the version instead. One issue was that there seems to be the same duplicate logic in multiple places, where, for example, the virtual text in that PR still had issues, so its location would also need to be fixed.
I would be willing to work on this, but not sure all the locations that need to be updated. There is also some direct reexporting of the unicode-width functions in the unicode module that are used, rather than wrappers where we could run our logic in one space, rather than all over as is now.
While this refactor could be smaller in scope to just get the newline issue resolved, I think it might also be worth it to do a larger refactor to clean up some of the duplicated code everywhere, if possible.
