Skip to content

fix multiple character display-related issues#24

Open
jsteemann wants to merge 1 commit into
jart:masterfrom
jsteemann:bug-fix/fix-multi-byte-issues
Open

fix multiple character display-related issues#24
jsteemann wants to merge 1 commit into
jart:masterfrom
jsteemann:bug-fix/fix-multi-byte-issues

Conversation

@jsteemann

Copy link
Copy Markdown

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 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 jart#14
- adds external `wcwidth` function maintained at
  https://raw.githubusercontent.com/termux/wcwidth/master/wcwidth.c
@jsteemann jsteemann changed the title fix multiple character displayed-related issues fix multiple character display-related issues Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant