diff options
| -rw-r--r-- | st.c | 11 |
1 files changed, 6 insertions, 5 deletions
| @@ -678,7 +678,7 @@ bpress(XEvent *e) { | |||
| 678 | 678 | ||
| 679 | void | 679 | void |
| 680 | selcopy(void) { | 680 | selcopy(void) { |
| 681 | char *str, *ptr, *p; | 681 | char *str, *ptr; |
| 682 | int x, y, bufsize, is_selected = 0, size; | 682 | int x, y, bufsize, is_selected = 0, size; |
| 683 | Glyph *gp; | 683 | Glyph *gp; |
| 684 | 684 | ||
| @@ -693,11 +693,12 @@ selcopy(void) { | |||
| 693 | for(x = 0; x < term.col; x++) { | 693 | for(x = 0; x < term.col; x++) { |
| 694 | gp = &term.line[y][x]; | 694 | gp = &term.line[y][x]; |
| 695 | 695 | ||
| 696 | if(!(is_selected = selected(x, y))) | 696 | if(!(is_selected = selected(x, y)) |
| 697 | || !(gp->state & GLYPH_SET)) { | ||
| 697 | continue; | 698 | continue; |
| 698 | p = (gp->state & GLYPH_SET) ? gp->c : " "; | 699 | } |
| 699 | size = utf8size(p); | 700 | size = utf8size(gp->c); |
| 700 | memcpy(ptr, p, size); | 701 | memcpy(ptr, gp->c, size); |
| 701 | ptr += size; | 702 | ptr += size; |
| 702 | } | 703 | } |
| 703 | /* \n at the end of every selected line except for the last one */ | 704 | /* \n at the end of every selected line except for the last one */ |
