---
st.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff -r 8a10729d93c9 -r 522c577a2962 st.c
--- a/st.c Mon Sep 17 22:11:28 2012 +0200
+++ b/st.c Mon Sep 17 22:13:09 2012 +0200
_AT_@ -596,14 +596,17 @@
/* append every set & selected glyph to the selection */
for(y = 0; y < term.row; y++) {
for(x = 0; x < term.col; x++) {
- is_selected = selected(x, y);
- if((term.line[y][x].state & GLYPH_SET) && is_selected) {
- int size = utf8size(term.line[y][x].c);
- memcpy(ptr, term.line[y][x].c, size);
- ptr += size;
- }
+ int size;
+ char *p;
+ Glyph *gp = &term.line[y][x];
+
+ if(!(is_selected = selected(x, y)))
+ continue;
+ p = (gp->state & GLYPH_SET) ? gp->c : " ";
+ size = utf8size(p);
+ memcpy(ptr, p, size);
+ ptr += size;
}
-
/* \n at the end of every selected line except for the last one */
if(is_selected && y < sel.e.y)
*ptr++ = '\n';
Received on Mon Sep 17 2012 - 22:46:40 CEST
This archive was generated by hypermail 2.3.0 : Mon Sep 17 2012 - 22:48:07 CEST