maskmode didn't really work with characters that would need more than 1 display unit (width > 1).
the display width of several characters wasn't correct before, especially for some emojis. fix this by replacing the code in GetMonospaceCharacterWidth with a call to wcwidth, which seems to be more accurate (but complex) for determining display widths.
when the cursor was positioned at the last column in a row, and then a character was entered, the cursor advanced correctly to the beginning of the next line, but the just-entered character wasn't displayed. only when another character was entered, the previous character would be displayed just fine.
fixes several issues in bestline:
maskmode didn't really work with characters that would need more than 1 display unit (width > 1).
the display width of several characters wasn't correct before, especially for some emojis. fix this by replacing the code in GetMonospaceCharacterWidth with a call to
wcwidth
, which seems to be more accurate (but complex) for determining display widths.when the cursor was positioned at the last column in a row, and then a character was entered, the cursor advanced correctly to the beginning of the next line, but the just-entered character wasn't displayed. only when another character was entered, the previous character would be displayed just fine.
fixes issue #14
adds external
wcwidth
function maintained at https://raw.githubusercontent.com/termux/wcwidth/master/wcwidth.c