add a keybind for toggling highlighting

This commit is contained in:
speedie 2023-04-21 12:10:02 +02:00
parent ea7ffdb66a
commit c0611034aa
3 changed files with 9 additions and 0 deletions

View file

@ -88,6 +88,7 @@ static Key keys[] = {
{ 0, CONTROL|ALT|SHIFT, XK_h, setcolumns, {.i = +5 } },
{ 0, CONTROL|ALT|SHIFT, XK_l, setcolumns, {.i = -5 } },
{ 0, CONTROL, XK_k, restoresel, {0} },
{ 0, 0, XK_u, togglehighlight, {0} },
{ 0, CONTROL|SHIFT, XK_h, viewhist, {0} },
{ 0, 0, XK_d, clear, {0} },
{ 0, 0, XK_c, clearins, {0} },

View file

@ -532,3 +532,10 @@ spawn(const Arg *arg)
fprintf(stderr, "spmenu: failed to execute command '%s'", ((char **)arg->v)[0]);
}
}
void
togglehighlight(const Arg *arg)
{
hidehighlight = !hidehighlight;
drawmenu();
}

View file

@ -39,3 +39,4 @@ static void setlines(const Arg *arg);
static void setcolumns(const Arg *arg);
static void setprofile(const Arg *arg);
static void spawn(const Arg *arg);
static void togglehighlight(const Arg *arg);