[dev] [PATCH] Don't insert newlines in wrapped lines

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Sat, 10 Aug 2013 10:37:30 +0200

When a line doesn't fit in a row of the terminal it is wrapped, so next
characters of the line are shown in the next row. st adds always a newline
character when rows are copied, but it causes that in wrapped lines
a non needed newline is appended. The solution is easy, don't add the
newline when there is a character in the last position of the row.
---
 st.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/st.c b/st.c
index 1b01353..29a8a1d 100644
--- a/st.c
+++ b/st.c
_AT_@ -974,7 +974,7 @@ selcopy(void) {
 				ex = sel.ne.x;
 				if(sel.nb.y == sel.ne.y && sel.ne.x < sel.nb.x)
 					ex = sel.nb.x;
-				if(i < ex)
+				if(i < ex && i != term.col - 1)
 					*ptr++ = '\n';
 			}
 		}
-- 
1.8.3.3
Received on Sat Aug 10 2013 - 10:37:30 CEST

This archive was generated by hypermail 2.3.0 : Sat Aug 10 2013 - 10:48:05 CEST