st

simple terminal

git clone https://9o.is/git/st.git

commit 82600ae54f16e40e5e8a1f17647074f7e599199f
parent 515ac935746773941fb3b49eab2ddf4e22d42a15
Author: Ivan Delalande <colona@ycc.fr>
Date:   Sun, 16 Nov 2014 09:02:57 +0100

Trim trailing whitespaces in every selection case

Trailing whitespaces are trimmed when copying from normal selection and
rectangular selection on lines that have their last character included
or on the left of the selection. It leads to inconsistent behaviors when
copying the exact same text from the left and right window in
applications with vertical splits.
This patch solves this issue by always trimming the selection.

Diffstat:
Mst.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/st.c b/st.c @@ -947,6 +947,8 @@ getsel(void) { lastx = (sel.ne.y == y) ? sel.ne.x : term.col-1; } last = &term.line[y][MIN(lastx, linelen-1)]; + while(last >= gp && last->c[0] == ' ') + --last; for( ; gp <= last; ++gp) { if(gp->mode & ATTR_WDUMMY)