[hackers] [st] Strip trailing spaces from lines when copying selection. || Alexander Sedov

From: <git_AT_suckless.org>
Date: Sun, 14 Apr 2013 21:34:46 +0200

commit 0ca0dd8b11ec0febc547e485395b7c9ec01e2866
Author: Alexander Sedov <alex0player_AT_gmail.com>
Date: Sun Apr 14 23:17:44 2013 +0400

    Strip trailing spaces from lines when copying selection.
    
    Signed-off-by: Christoph Lohmann <20h_AT_r-36.net>

diff --git a/st.c b/st.c
index 7250da2..56dc94c 100644
--- a/st.c
+++ b/st.c
_AT_@ -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) {
Received on Sun Apr 14 2013 - 21:34:46 CEST

This archive was generated by hypermail 2.3.0 : Sun Apr 14 2013 - 21:36:18 CEST