[hackers] [st] do not add newline to selection text if next line not selected (Nick) || pancake

From: <hg_AT_suckless.org>
Date: Fri, 1 Apr 2011 07:49:54 +0000 (UTC)

changeset: 182:054fe4c29819
tag: tip
user: pancake_AT_nopcode.org
date: Fri Apr 01 09:35:38 2011 +0200
files: st.c
description:
do not add newline to selection text if next line not selected (Nick)

diff -r 0f23f800c6fc -r 054fe4c29819 st.c
--- a/st.c Fri Apr 01 09:33:28 2011 +0200
+++ b/st.c Fri Apr 01 09:35:38 2011 +0200
@@ -420,8 +420,8 @@
                                         memcpy(ptr, term.line[y][x].c, sl);
                                         ptr += sl;
                                 }
- if(ls)
- *ptr = '\n', ptr++;
+ if(ls && y < sel.e.y)
+ *ptr++ = '\n';
                 }
                 *ptr = 0;
         }
Received on Fri Apr 01 2011 - 09:49:54 CEST

This archive was generated by hypermail 2.2.0 : Fri Apr 01 2011 - 10:00:09 CEST