Changing the way how paste is handled, just for the nano people.
[st.git] / st.c
diff --git a/st.c b/st.c
index 9f5793c..8b5ba64 100644 (file)
--- a/st.c
+++ b/st.c
@@ -796,7 +796,7 @@ selcopy(void) {
                        }
                        /* \n at the end of every selected line except for the last one */
                        if(is_selected && y < sel.e.y)
-                               *ptr++ = '\n';
+                               *ptr++ = '\r';
                }
                *ptr = 0;
        }
@@ -1295,7 +1295,6 @@ tnewline(int first_col) {
 
 void
 csiparse(void) {
-       /* int noarg = 1; */
        char *p = csiescseq.buf, *np;
        long int v;
 
@@ -1306,9 +1305,10 @@ csiparse(void) {
        }
 
        while(p < csiescseq.buf+csiescseq.len) {
+               np = NULL;
                v = strtol(p, &np, 10);
                if(np == p)
-                       break;
+                       v = 0;
                if(v == LONG_MAX || v == LONG_MIN)
                        v = -1;
                csiescseq.arg[csiescseq.narg++] = v;