Double-width UTF-encoded symbols (e.g., emojis, full-width East Asian chars, etc.) don't render properly, as all characters are expected to have a width of 1. To see this, change rx += 1 to rx += 2 in cx_to_rx, and cur_rx += 1 to cur_rx += 2 in rx_to_cx. The cursor will position correctly when adding an emoji, for instance, but will break for single-width Unicode chars.
Sounds like we need to use wcwidth and wcswidth to get the actual width of these when rendering.
Double-width UTF-encoded symbols (e.g., emojis, full-width East Asian chars, etc.) don't render properly, as all characters are expected to have a width of 1. To see this, change
rx += 1torx += 2incx_to_rx, andcur_rx += 1tocur_rx += 2inrx_to_cx. The cursor will position correctly when adding an emoji, for instance, but will break for single-width Unicode chars.Sounds like we need to use
wcwidthandwcswidthto get the actual width of these when rendering.