X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=0c528d5abe6432b1467ae998cc4c2deee9469962;hb=91c70213d1e595467b14ce6d28f333dbedd97cab;hp=144954bc07f7ecf56151188279b9792a250dbe52;hpb=5ece2b5f4a2e56ddfb82e797dc973fca38c5273d;p=st.git diff --git a/st.c b/st.c index 144954b..0c528d5 100644 --- a/st.c +++ b/st.c @@ -1811,6 +1811,7 @@ tmoveto(int x, int y) { int miny, maxy; + selclear(NULL); if (term.c.state & CURSOR_ORIGIN) { miny = term.top; maxy = term.bot; @@ -3828,6 +3829,7 @@ xdrawcursor(void) static int oldx = 0, oldy = 0; int curx; Glyph g = {' ', ATTR_NULL, defaultbg, defaultcs}; + int ena_sel = sel.ob.x != -1 && sel.alt == IS_SET(MODE_ALTSCREEN); LIMIT(oldx, 0, term.col-1); LIMIT(oldy, 0, term.row-1); @@ -3841,6 +3843,8 @@ xdrawcursor(void) curx--; g.u = term.line[term.c.y][term.c.x].u; + if (ena_sel && selected(term.c.x, term.c.y)) + g.mode ^= ATTR_REVERSE; /* remove the old cursor */ xdrawglyph(term.line[oldy][oldx], oldx, oldy);