Have selected() check whether selection exists
[st.git] / st.c
diff --git a/st.c b/st.c
index dae7b91..d4dfe6e 100644 (file)
--- a/st.c
+++ b/st.c
@@ -419,7 +419,8 @@ selnormalize(void)
 int
 selected(int x, int y)
 {
-       if (sel.mode == SEL_EMPTY)
+       if (sel.mode == SEL_EMPTY || sel.ob.x == -1 ||
+                       sel.alt != IS_SET(MODE_ALTSCREEN))
                return 0;
 
        if (sel.type == SEL_RECTANGULAR)