X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=7c15d5f68fdc6d52b75b14d0c0d63ad78215a318;hb=9c30066e73f0105c3fccb7582c8172d5117857b3;hp=5d4054f619f6646ffe5db2d5768cfbddf6254a2d;hpb=8211e36d281990a39db1853bcd454ac59e53d521;p=st.git diff --git a/st.c b/st.c index 5d4054f..7c15d5f 100644 --- a/st.c +++ b/st.c @@ -634,7 +634,8 @@ getsel(void) * st. * FIXME: Fix the computer world. */ - if ((y < sel.ne.y || lastx >= linelen) && !(last->mode & ATTR_WRAP)) + if ((y < sel.ne.y || lastx >= linelen) && + (!(last->mode & ATTR_WRAP) || sel.type == SEL_RECTANGULAR)) *ptr++ = '\n'; } *ptr = 0; @@ -2153,6 +2154,7 @@ tcontrolcode(uchar ascii) return; case '\032': /* SUB */ tsetchar('?', &term.c.attr, term.c.x, term.c.y); + /* FALLTHROUGH */ case '\030': /* CAN */ csireset(); break; @@ -2307,7 +2309,7 @@ tputc(Rune u) Glyph *gp; control = ISCONTROL(u); - if (!IS_SET(MODE_UTF8 | MODE_SIXEL)) { + if (u < 127 || !IS_SET(MODE_UTF8 | MODE_SIXEL)) { c[0] = u; width = len = 1; } else { @@ -2411,7 +2413,7 @@ check_control_code: */ return; } - if (sel.ob.x != -1 && BETWEEN(term.c.y, sel.ob.y, sel.oe.y)) + if (selected(term.c.x, term.c.y)) selclear(); gp = &term.line[term.c.y][term.c.x];