commit 0ca0dd8b11ec0febc547e485395b7c9ec01e2866 from: Alexander Sedov via: Christoph Lohmann <20h@r-36.net> date: Sun Apr 14 19:32:53 2013 UTC Strip trailing spaces from lines when copying selection. Signed-off-by: Christoph Lohmann <20h@r-36.net> commit - c371fe58a36abbfbf684e62d6b4026173dbc79be commit + 0ca0dd8b11ec0febc547e485395b7c9ec01e2866 blob - 7250da22c9068ccefcc5c9c1ec914eed71e26cbd blob + 56dc94c611b9016a9ad5852d2ebecabe1e6feb37 --- st.c +++ st.c @@ -773,7 +773,8 @@ selcopy(void) { 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) {