st.c | 3 ++- diff --git a/st.c b/st.c index 7250da22c9068ccefcc5c9c1ec914eed71e26cbd..56dc94c611b9016a9ad5852d2ebecabe1e6feb37 100644 --- a/st.c +++ b/st.c @@ -773,7 +773,8 @@ isselected = 0; gp = &term.line[y][0]; last = gp + term.col; - while(--last >= gp && !(last->state & GLYPH_SET)) + while(--last >= gp && !((last->state & GLYPH_SET) && \ + selected(last - gp, y) && strcmp(last->c, " ") != 0)) /* nothing */; for(x = 0; gp <= last; x++, ++gp) {