aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Sedov <alex0player@gmail.com>2013-04-14 23:17:44 +0400
committerChristoph Lohmann <20h@r-36.net>2013-04-14 21:32:53 +0200
commit0ca0dd8b11ec0febc547e485395b7c9ec01e2866 (patch)
tree5e04f896052180fc1022053320fe512f06bfc37e
parentc371fe58a36abbfbf684e62d6b4026173dbc79be (diff)
downloadst-0ca0dd8b11ec0febc547e485395b7c9ec01e2866.tar.gz
st-0ca0dd8b11ec0febc547e485395b7c9ec01e2866.zip
Strip trailing spaces from lines when copying selection.
Signed-off-by: Christoph Lohmann <20h@r-36.net>
-rw-r--r--st.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/st.c b/st.c
index 7250da2..56dc94c 100644
--- a/st.c
+++ b/st.c
@@ -773,7 +773,8 @@ selcopy(void) {
773 gp = &term.line[y][0]; 773 gp = &term.line[y][0];
774 last = gp + term.col; 774 last = gp + term.col;
775 775
776 while(--last >= gp && !(last->state & GLYPH_SET)) 776 while(--last >= gp && !((last->state & GLYPH_SET) && \
777 selected(last - gp, y) && strcmp(last->c, " ") != 0))
777 /* nothing */; 778 /* nothing */;
778 779
779 for(x = 0; gp <= last; x++, ++gp) { 780 for(x = 0; gp <= last; x++, ++gp) {