JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
do not add newline to selection text if next line not selected (Nick)
[st.git] / st.c
diff --git a/st.c b/st.c
index d528828..561d5b0 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;
        }
@@ -935,7 +935,7 @@ csihandle(void) {
        switch(escseq.mode) {
        default:
        unknown:
-               printf("erresc: unknown csi ");
+               fprintf(stderr, "erresc: unknown csi ");
                csidump();
                /* die(""); */
                break;
@@ -1207,7 +1207,7 @@ tputc(char *c) {
                                term.c.attr.mode &= ~ATTR_GFX;
                                break;
                        default:
-                               printf("esc unhandled charset: ESC ( %c\n", ascii);
+                               fprintf(stderr, "esc unhandled charset: ESC ( %c\n", ascii);
                        }
                        term.esc = 0;
                } else {
@@ -1794,8 +1794,7 @@ kpress(XEvent *ev) {
                                if(meta && len == 1)
                                        ttywrite("\033", 1);
                                ttywrite(buf, len);
-                       } else /* 4. nothing to send */
-                               fprintf(stderr, "errkey: %d\n", (int)ksym);
+                       }
                        break;
                }
 }