Xinqi Bao's Git
projects
/
st.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
Selection now handles empty lines less counter-intuitively.
[st.git]
/
st.c
diff --git
a/st.c
b/st.c
index
8e39ec2
..
686ed5d
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-752,7
+752,7
@@
bpress(XEvent *e) {
void
selcopy(void) {
char *str, *ptr;
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) {
Glyph *gp, *last;
if(sel.bx == -1) {
@@
-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++) {
/* 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;
gp = &term.line[y][0];
last = gp + term.col;
@@
-774,8
+773,6
@@
selcopy(void) {
for(x = 0; gp <= last; x++, ++gp) {
if(!selected(x, y)) {
continue;
for(x = 0; gp <= last; x++, ++gp) {
if(!selected(x, y)) {
continue;
- } else {
- isselected = 1;
}
size = utf8size(gp->c);
}
size = utf8size(gp->c);
@@
-792,7
+789,7
@@
selcopy(void) {
* st.
* FIXME: Fix the computer world.
*/
* st.
* FIXME: Fix the computer world.
*/
- if(
isselected &&
y < sel.e.y)
+ if(y < sel.e.y)
*ptr++ = '\n';
}
*ptr = 0;
*ptr++ = '\n';
}
*ptr = 0;