pinosaur
/
st.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix empty selection highlighting bug.
[st.git]
/
st.c
diff --git
a/st.c
b/st.c
index
d6dd4de
..
3eb66fa
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-716,6
+716,9
@@
selnormalize(void) {
bool
selected(int x, int y) {
bool
selected(int x, int y) {
+ if(sel.mode == SEL_EMPTY)
+ return false;
+
if(sel.type == SEL_RECTANGULAR)
return BETWEEN(y, sel.nb.y, sel.ne.y)
&& BETWEEN(x, sel.nb.x, sel.ne.x);
if(sel.type == SEL_RECTANGULAR)
return BETWEEN(y, sel.nb.y, sel.ne.y)
&& BETWEEN(x, sel.nb.x, sel.ne.x);
@@
-921,14
+924,9
@@
bpress(XEvent *e) {
}
selnormalize();
}
selnormalize();
- /*
- * Draw selection, unless it's regular and we don't want to
- * make clicks visible
- */
- if(sel.snap != 0) {
+ if(sel.snap != 0)
sel.mode = SEL_READY;
sel.mode = SEL_READY;
- tsetdirt(sel.nb.y, sel.ne.y);
- }
+ tsetdirt(sel.nb.y, sel.ne.y);
sel.tclick2 = sel.tclick1;
sel.tclick1 = now;
}
sel.tclick2 = sel.tclick1;
sel.tclick1 = now;
}
@@
-1084,8
+1082,8
@@
selrequest(XEvent *e) {
xev.selection = xsre->selection;
xev.target = xsre->target;
xev.time = xsre->time;
xev.selection = xsre->selection;
xev.target = xsre->target;
xev.time = xsre->time;
-
if (xsre->property == None)
- xsre->property = xsre->target;
+ if (xsre->property == None)
+
xsre->property = xsre->target;
/* reject */
xev.property = None;
/* reject */
xev.property = None;
@@
-1134,8
+1132,8
@@
xsetsel(char *str, Time t) {
sel.primary = str;
XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t);
sel.primary = str;
XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t);
-
if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win)
- selclear(0);
+ if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win)
+
selclear(0);
}
void
}
void