Applying the patch of Rafa Garcia Gallega <rafael.garcia.gallego@gmail.com> to

not emulate the vt100 behaviour of selecting all whitespaces. Thanks!
This commit is contained in:
Christoph Lohmann 2012-10-28 06:32:54 +01:00
parent ee3fbeb6c8
commit 35421371ca
1 changed files with 6 additions and 5 deletions

11
st.c
View File

@ -678,7 +678,7 @@ bpress(XEvent *e) {
void void
selcopy(void) { selcopy(void) {
char *str, *ptr, *p; char *str, *ptr;
int x, y, bufsize, is_selected = 0, size; int x, y, bufsize, is_selected = 0, size;
Glyph *gp; Glyph *gp;
@ -693,11 +693,12 @@ selcopy(void) {
for(x = 0; x < term.col; x++) { for(x = 0; x < term.col; x++) {
gp = &term.line[y][x]; gp = &term.line[y][x];
if(!(is_selected = selected(x, y))) if(!(is_selected = selected(x, y))
|| !(gp->state & GLYPH_SET)) {
continue; continue;
p = (gp->state & GLYPH_SET) ? gp->c : " "; }
size = utf8size(p); size = utf8size(gp->c);
memcpy(ptr, p, size); memcpy(ptr, gp->c, size);
ptr += size; ptr += size;
} }
/* \n at the end of every selected line except for the last one */ /* \n at the end of every selected line except for the last one */