diff options
author | Mark Edgar <medgar123@gmail.com> | 2013-10-19 15:13:13 +0200 |
---|---|---|
committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2013-10-28 19:28:52 +0100 |
commit | 7263820759aa914b27ab3097613bdf22432ed736 (patch) | |
tree | dc548cd605bbc50adc2cac3d2c7e583bdde782aa /st.c | |
parent | 1fa27b93f9a78ee78a35a5449bb8c4d0c3ef0f1b (diff) | |
download | st-7263820759aa914b27ab3097613bdf22432ed736.tar.gz |
Simplify logic in kmap().
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 19 |
1 files changed, 5 insertions, 14 deletions
@@ -3531,25 +3531,16 @@ kmap(KeySym k, uint state) { if(!match(kp->mask, state)) continue; - if(kp->appkey > 0) { - if(!IS_SET(MODE_APPKEYPAD)) - continue; - if(term.numlock && kp->appkey == 2) - continue; - } else if(kp->appkey < 0 && IS_SET(MODE_APPKEYPAD)) { + if(IS_SET(MODE_APPKEYPAD) ? kp->appkey < 0 : kp->appkey > 0) + continue; + if(term.numlock && kp->appkey == 2) continue; - } - if((kp->appcursor < 0 && IS_SET(MODE_APPCURSOR)) || - (kp->appcursor > 0 - && !IS_SET(MODE_APPCURSOR))) { + if(IS_SET(MODE_APPCURSOR) ? kp->appcursor < 0 : kp->appcursor > 0) continue; - } - if((kp->crlf < 0 && IS_SET(MODE_CRLF)) || - (kp->crlf > 0 && !IS_SET(MODE_CRLF))) { + if(IS_SET(MODE_CRLF) ? kp->crlf < 0 : kp->crlf > 0) continue; - } return kp->s; } |