X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=x.c;h=ab9593ead339ee991129a86da63728a01576adc1;hb=77c51c5a6b16387f1792e23acbcf2080f790aa25;hp=b7339e93f209ebbf31c3a17a0ea0e0ae5803d6e1;hpb=f2bfd513b14a2aa27796670235557a550b4189db;p=st.git diff --git a/x.c b/x.c index b7339e9..ab9593e 100644 --- a/x.c +++ b/x.c @@ -507,6 +507,7 @@ xsetsel(char *str, Time t) XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t); if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win) selclear_(NULL); + xclipcopy(); } void @@ -1266,7 +1267,6 @@ xdrawcursor(void) Glyph g = {' ', ATTR_NULL, defaultbg, defaultcs}, og; int ena_sel = sel.ob.x != -1 && sel.alt == IS_SET(MODE_ALTSCREEN); Color drawcol; - unsigned attr; LIMIT(oldx, 0, term.col-1); LIMIT(oldy, 0, term.row-1); @@ -1286,8 +1286,8 @@ xdrawcursor(void) xdrawglyph(og, oldx, oldy); g.u = term.line[term.c.y][term.c.x].u; - attr = ATTR_BOLD | ATTR_ITALIC | ATTR_UNDERLINE | ATTR_STRUCK; - g.mode |= term.line[term.c.y][term.c.x].mode & attr; + g.mode |= term.line[term.c.y][term.c.x].mode & + (ATTR_BOLD | ATTR_ITALIC | ATTR_UNDERLINE | ATTR_STRUCK); /* * Select the right color for the right mode.