all repos — st @ 09f5d98251469070b76f3911cc6a83d977871656

st (suckless terminal) config

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.
Ivan Delalande colona@ycc.fr
commit

09f5d98251469070b76f3911cc6a83d977871656

parent

4418939dd9f3a7b3cfd3071234ed18ae86538f2a

1 files changed, 2 insertions(+), 0 deletions(-)

jump to
M st.cst.c

@@ -947,6 +947,8 @@ gp = &term.line[y][sel.nb.y == y ? sel.nb.x : 0];

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)