X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=dmenu.c;h=99db24e74e933fab04c06cc31564f3c711ee6f80;hb=6b1d658d1224cd108d64a6c340d47b66ad99816d;hp=3f48d30489291389243ee4258f427298cb9f6eeb;hpb=dc77337ef35a52e1da8a74339bc39f32e6e5ab56;p=dmenu.git diff --git a/dmenu.c b/dmenu.c index 3f48d30..99db24e 100644 --- a/dmenu.c +++ b/dmenu.c @@ -45,10 +45,10 @@ static int inputw, promptw; static size_t cursor = 0; static const char *font = NULL; static const char *prompt = NULL; -static const char *normbgcolor = "#cccccc"; -static const char *normfgcolor = "#000000"; -static const char *selbgcolor = "#0066ff"; -static const char *selfgcolor = "#ffffff"; +static const char *normbgcolor = "#222222"; +static const char *normfgcolor = "#bbbbbb"; +static const char *selbgcolor = "#005577"; +static const char *selfgcolor = "#eeeeee"; static unsigned int lines = 0; static unsigned long normcol[ColLast]; static unsigned long selcol[ColLast]; @@ -258,8 +258,8 @@ keypress(XKeyEvent *ev) { case XK_i: ksym = XK_Tab; break; case XK_j: ksym = XK_Return; break; case XK_m: ksym = XK_Return; break; - case XK_n: ksym = XK_Up; break; - case XK_p: ksym = XK_Down; break; + case XK_n: ksym = XK_Down; break; + case XK_p: ksym = XK_Up; break; case XK_k: /* delete right */ text[cursor] = '\0'; @@ -328,6 +328,8 @@ keypress(XKeyEvent *ev) { cursor = nextrune(-1); break; } + if(lines > 0) + return; /* fallthrough */ case XK_Up: if(sel && sel->left && (sel = sel->left)->right == curr) { @@ -356,6 +358,8 @@ keypress(XKeyEvent *ev) { cursor = nextrune(+1); break; } + if(lines > 0) + return; /* fallthrough */ case XK_Down: if(sel && sel->right && (sel = sel->right) == next) {