Have selected() check whether selection exists

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
This commit is contained in:
Devin J. Pohly
2018-02-21 22:48:28 -06:00
parent d84f3f4bd1
commit 138caf294e
2 changed files with 6 additions and 7 deletions

3
st.c
View File

@ -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)