Explorar o código

Strip trailing spaces from lines when copying selection.

Signed-off-by: Christoph Lohmann <20h@r-36.net>
Alexander Sedov %!s(int64=12) %!d(string=hai) anos
pai
achega
0ca0dd8b11
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      st.c

+ 2 - 1
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) {