[hackers] [st] Applying the patch of Rafa Garcia Gallega <rafael.garcia.gallego_AT_gmail.com> to || Christoph Lohmann

From: <hg_AT_suckless.org>
Date: Sun, 28 Oct 2012 13:39:03 +0100 (CET)

changeset: 367:d61db297d6c1
user: Christoph Lohmann <20h_AT_r-36.net>
date: Sun Oct 28 06:32:54 2012 +0100
files: st.c
description:
Applying the patch of Rafa Garcia Gallega <rafael.garcia.gallego_AT_gmail.com> to
not emulate the vt100 behaviour of selecting all whitespaces. Thanks!


diff -r d3f0d0140295 -r d61db297d6c1 st.c
--- a/st.c Sun Oct 28 06:27:42 2012 +0100
+++ b/st.c Sun Oct 28 06:32:54 2012 +0100
_AT_@ -678,7 +678,7 @@
 
 void
 selcopy(void) {
- char *str, *ptr, *p;
+ char *str, *ptr;
         int x, y, bufsize, is_selected = 0, size;
         Glyph *gp;
 
_AT_@ -693,11 +693,12 @@
                         for(x = 0; x < term.col; x++) {
                                 gp = &term.line[y][x];
 
- if(!(is_selected = selected(x, y)))
+ if(!(is_selected = selected(x, y))
+ || !(gp->state & GLYPH_SET)) {
                                         continue;
- p = (gp->state & GLYPH_SET) ? gp->c : " ";
- size = utf8size(p);
- memcpy(ptr, p, size);
+ }
+ size = utf8size(gp->c);
+ memcpy(ptr, gp->c, size);
                                 ptr += size;
                         }
                         /* \n at the end of every selected line except for the last one */
Received on Sun Oct 28 2012 - 13:39:03 CET

This archive was generated by hypermail 2.3.0 : Sun Oct 28 2012 - 13:48:23 CET