]> Sergey Matveev's repositories - st.git/blobdiff - st.c
Fix for wide character being incorrectly cleared on MODE_INSERT
[st.git] / st.c
diff --git a/st.c b/st.c
index 49357cc9d11b1ad6bd8a954ee626f3a5d309877b..623376e1b172781f66dd21ef220e165a8146eaad 100644 (file)
--- a/st.c
+++ b/st.c
@@ -2422,6 +2422,9 @@ check_control_code:
         * they must not cause conflicts with sequences.
         */
        if (control) {
+               /* in UTF-8 mode ignore handling C1 control characters */
+               if (IS_SET(MODE_UTF8) && ISCONTROLC1(u))
+                       return;
                tcontrolcode(u);
                /*
                 * control codes are not shown ever
@@ -2468,8 +2471,10 @@ check_control_code:
                gp = &term.line[term.c.y][term.c.x];
        }
 
-       if (IS_SET(MODE_INSERT) && term.c.x+width < term.col)
+       if (IS_SET(MODE_INSERT) && term.c.x+width < term.col) {
                memmove(gp+width, gp, (term.col - term.c.x - width) * sizeof(Glyph));
+               gp->mode &= ~ATTR_WIDE;
+       }
 
        if (term.c.x+width > term.col) {
                tnewline(1);