Compare commits

...

2 Commits

Author SHA1 Message Date
hazen2215 807e428b98 make ^U delete whole line 2022-03-28 07:58:43 +09:00
hazen2215 7050df36bb add config.h 2022-03-28 07:55:59 +09:00
2 changed files with 25 additions and 3 deletions

23
config.h Normal file
View File

@ -0,0 +1,23 @@
/* See LICENSE file for copyright and license details. */
/* Default settings; can be overriden by command line. */
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
/* -fn option overrides fonts[0]; default X11 font or font set */
static const char *fonts[] = {
"monospace:size=10", "IPAGothic:size=10", "Symbola:size=10"
};
static const char *prompt = NULL; /* -p option; prompt to the left of input field */
static const char *colors[SchemeLast][2] = {
/* fg bg */
[SchemeNorm] = { "#bbbbbb", "#222222" },
[SchemeSel] = { "#eeeeee", "#005577" },
[SchemeOut] = { "#000000", "#00ffff" },
};
/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
static unsigned int lines = 0;
/*
* Characters not considered part of a word while deleting words
* for example: " /?\"&[]"
*/
static const char worddelimiters[] = " ";

View File

@ -358,13 +358,12 @@ keypress(XKeyEvent *ev)
case XK_n: ksym = XK_Down; break;
case XK_p: ksym = XK_Up; break;
case XK_u: /* delete left */
insert(NULL, 0 - cursor);
case XK_k: /* delete right */
text[cursor] = '\0';
match();
break;
case XK_u: /* delete left */
insert(NULL, 0 - cursor);
break;
case XK_w: /* delete word */
while (cursor > 0 && strchr(worddelimiters, text[nextrune(-1)]))
insert(NULL, nextrune(-1) - cursor);