aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Edgar2013-10-19 15:13:13 +0200
committerRoberto E. Vargas Caballero2013-10-28 19:28:52 +0100
commit03f263903529e9f0db05ccb2ebfec3bfb145b312 (patch)
tree4fd41e54ed975d1b64441cde99a470bf4ff89af0
parentfd9d5e8658e08ea1768658b095f8a2e68fb5bbc8 (diff)
downloadaur-03f263903529e9f0db05ccb2ebfec3bfb145b312.tar.gz
Simplify logic in kmap().
-rw-r--r--st.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/st.c b/st.c
index da2ce3f19431..fda70442e4b1 100644
--- a/st.c
+++ b/st.c
@@ -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;
}