RMichelsen / Nvy

Nvy - A Neovim client in C++
MIT License
334 stars 28 forks source link

Fix misplaced wide char #55

Closed statiolake closed 2 years ago

statiolake commented 2 years ago

It seems that sometimes grid_line event is splitted at the middle of wide character. In that case, first grid_line ends with left half of the wide character, and the second grid_line starts with empty string (meaning the right half of the wide character). In current implementation, however, treats the ending wide character as a single width charcter (because the first grid_line doesn't have the right half), and skips the initial empty string of the second grid_line (since text of strlen == 0 will be skipped).

This commit sets is_wide_char flag of the previous cell to true when we encountered the empty string, instead of when we have the empty string after current entry of grid_line (current implementation). With this change, such a splitted grid_line can also be handled correctly.

RMichelsen commented 2 years ago

Looks good! Thanks for the contribution 😊👍