JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Removing unneeded comments.
[st.git] / st.c
diff --git a/st.c b/st.c
index 7250da2..9587886 100644 (file)
--- a/st.c
+++ b/st.c
@@ -773,7 +773,8 @@ selcopy(void) {
                        gp = &term.line[y][0];
                        last = gp + term.col;
 
-                       while(--last >= gp && !(last->state & GLYPH_SET))
+                       while(--last >= gp && !((last->state & GLYPH_SET) && \
+                                               selected(last - gp, y) && strcmp(last->c, " ") != 0))
                                /* nothing */;
 
                        for(x = 0; gp <= last; x++, ++gp) {
@@ -1194,23 +1195,10 @@ treset(void) {
 
 void
 tnew(int col, int row) {
-       /* set screen size */
-       term.row = row;
-       term.col = col;
-       term.line = xmalloc(term.row * sizeof(Line));
-       term.alt  = xmalloc(term.row * sizeof(Line));
-       term.dirty = xmalloc(term.row * sizeof(*term.dirty));
-       term.tabs = xmalloc(term.col * sizeof(*term.tabs));
-
-       for(row = 0; row < term.row; row++) {
-               term.line[row] = xmalloc(term.col * sizeof(Glyph));
-               term.alt [row] = xmalloc(term.col * sizeof(Glyph));
-               term.dirty[row] = 0;
-       }
-
+       memset(&term, 0, sizeof(Term));
+       tresize(col, row);
        term.numlock = 1;
-       memset(term.tabs, 0, term.col * sizeof(*term.tabs));
-       /* setup screen */
+
        treset();
 }