Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix multiple character display-related issues #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jsteemann
Copy link

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