]> Sergey Matveev's repositories - st.git/commitdiff
do not add newline to selection text if next line not selected (Nick)
authorpancake@nopcode.org <unknown>
Fri, 1 Apr 2011 07:35:38 +0000 (09:35 +0200)
committerpancake@nopcode.org <unknown>
Fri, 1 Apr 2011 07:35:38 +0000 (09:35 +0200)
st.c

diff --git a/st.c b/st.c
index d0a607b116a36dc93a17a1702d81dcf9f17bbfc5..561d5b05c00c1900215e31e16250eca533e1c116 100644 (file)
--- a/st.c
+++ b/st.c
@@ -420,8 +420,8 @@ selcopy(void) {
                                        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;
        }