]> git.armaanb.net Git - st.git/commitdiff
set selection to IDLE on clear
authorv4hn <me@v4hn.de>
Thu, 14 May 2015 13:46:07 +0000 (15:46 +0200)
committerRoberto E. Vargas Caballero <k0ga@shike2.com>
Fri, 15 May 2015 05:42:40 +0000 (07:42 +0200)
Otherwise a tangling bmotion event will consider
the selection still valid and selnormalize segfaults
because of an invalid sel.ob.y index.

st.c

diff --git a/st.c b/st.c
index 73fe291bdf8355812ac3f625b0d951247cc6195f..c0a9bf3361f877c2939c4f7d922a04c828ebd23d 100644 (file)
--- a/st.c
+++ b/st.c
@@ -1069,6 +1069,7 @@ void
 selclear(XEvent *e) {
        if(sel.ob.x == -1)
                return;
+       sel.mode = SEL_IDLE;
        sel.ob.x = -1;
        tsetdirt(sel.nb.y, sel.ne.y);
 }