Xinqi Bao's Git
projects
/
st.git
/ commitdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
1fa27b9
)
Simplify logic in kmap().
author
Mark Edgar <
[email protected]
>
Sat, 19 Oct 2013 13:13:13 +0000
(15:13 +0200)
committer
Roberto E. Vargas Caballero <
[email protected]
>
Mon, 28 Oct 2013 18:28:52 +0000
(19:28 +0100)
st.c
patch
|
blob
|
history
diff --git
a/st.c
b/st.c
index
da2ce3f
..
fda7044
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-3531,25
+3531,16
@@
kmap(KeySym k, uint state) {
if(!match(kp->mask, state))
continue;
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;
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;
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;
continue;
- }
return kp->s;
}
return kp->s;
}