aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2012-10-28 06:32:54 +0100
committerChristoph Lohmann <20h@r-36.net>2012-10-28 06:32:54 +0100
commit4abecf9ce46680bf5dd3824554eb0a506bb51524 (patch)
tree071233f251151c201c8f7182ce4693b6ea14c952
parent5de1468554c98ed8a40ac3d1e5d5c7db2eb1480b (diff)
downloadst-patched-4abecf9ce46680bf5dd3824554eb0a506bb51524.tar.bz2
st-patched-4abecf9ce46680bf5dd3824554eb0a506bb51524.tar.xz
st-patched-4abecf9ce46680bf5dd3824554eb0a506bb51524.zip
Applying the patch of Rafa Garcia Gallega <rafael.garcia.gallego@gmail.com> to
not emulate the vt100 behaviour of selecting all whitespaces. Thanks!
-rw-r--r--st.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/st.c b/st.c
index e19cefd..3cd7831 100644
--- a/st.c
+++ b/st.c
@@ -678,7 +678,7 @@ bpress(XEvent *e) {
678 678
679void 679void
680selcopy(void) { 680selcopy(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 */