tSelection now handles empty lines less counter-intuitively. - st - [fork] cust… | |
git clone git://src.adamsgaard.dk/st | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit e5ff746430725b05e223c454febbde949df2fde2 | |
parent da182612b7c7a6be67b2c7be0c0d85562220f1e4 | |
Author: Alexander Sedov <[email protected]> | |
Date: Thu, 18 Apr 2013 12:47:23 +0400 | |
Selection now handles empty lines less counter-intuitively. | |
Now, when you are selecting a region, you will get all empty lines that happen | |
tto be in it, including trailing ones. Last line terminator is omitted as it pr… | |
was, though. | |
Signed-off-by: Christoph Lohmann <[email protected]> | |
Diffstat: | |
M st.c | 7 ++----- | |
1 file changed, 2 insertions(+), 5 deletions(-) | |
--- | |
diff --git a/st.c b/st.c | |
t@@ -752,7 +752,7 @@ bpress(XEvent *e) { | |
void | |
selcopy(void) { | |
char *str, *ptr; | |
- int x, y, bufsize, isselected = 0, size; | |
+ int x, y, bufsize, size; | |
Glyph *gp, *last; | |
if(sel.bx == -1) { | |
t@@ -763,7 +763,6 @@ selcopy(void) { | |
/* append every set & selected glyph to the selection */ | |
for(y = sel.b.y; y < sel.e.y + 1; y++) { | |
- isselected = 0; | |
gp = &term.line[y][0]; | |
last = gp + term.col; | |
t@@ -774,8 +773,6 @@ selcopy(void) { | |
for(x = 0; gp <= last; x++, ++gp) { | |
if(!selected(x, y)) { | |
continue; | |
- } else { | |
- isselected = 1; | |
} | |
size = utf8size(gp->c); | |
t@@ -792,7 +789,7 @@ selcopy(void) { | |
* st. | |
* FIXME: Fix the computer world. | |
*/ | |
- if(isselected && y < sel.e.y) | |
+ if(y < sel.e.y) | |
*ptr++ = '\n'; | |
} | |
*ptr = 0; |