diff src/libvterm/src/state.c @ 23890:57c71d51e937

patch 8.2.2487: terminal shows garbage after double-wide character Commit: https://github.com/vim/vim/commit/4549dad874244fe933b969e4ac0b41923ee70dc3 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 8 21:29:48 2021 +0100 patch 8.2.2487: terminal shows garbage after double-wide character Problem: Terminal shows garbage after double-wide character with a combining character. (Kyoichiro Yamada) Solution: Libvterm: do not add the width of the combining character to the glyph width. (closes #7801)
author Bram Moolenaar <Bram@vim.org>
date Mon, 08 Feb 2021 21:30:06 +0100
parents e86237409bd2
children f93337ae0612
line wrap: on
line diff
--- a/src/libvterm/src/state.c
+++ b/src/libvterm/src/state.c
@@ -384,7 +384,8 @@ static int on_text(const char bytes[], s
         abort();
       }
 #endif
-      width += this_width;
+      if (i == glyph_starts || this_width > width)
+	width = this_width;
     }
 
     chars[glyph_ends - glyph_starts] = 0;