add hidemode option

This commit is contained in:
speedie 2023-02-25 18:14:27 +01:00
parent abd9f68f96
commit 07c66d4849
4 changed files with 12 additions and 2 deletions

View file

@ -59,6 +59,7 @@ spmenu.leftarrow: <
spmenu.rightarrow: >
spmenu.hidematchcount: 0
spmenu.hidehighlight: 0
spmenu.hidemode: 0
spmenu.imagesize: 86
spmenu.imagegaps: 0
spmenu.imageposition: 0

View file

@ -57,6 +57,7 @@ static char *prompt = NULL; /* Default prompt, set to NULL (n
/* Hide options */
static int hidematchcount = 0; /* Hide match count (0/1) */
static int hidemode = 0; /* Hide mode (0/1) */
static int hidehighlight = 0; /* Hide highlight (0/1) */
/* Color options

View file

@ -384,6 +384,8 @@ switchmode(const Arg *arg)
strcpy(modetext, "Insert");
}
if (hidemode) strcpy(modetext, "");
drawmenu();
}
@ -631,6 +633,9 @@ drawmenu(void)
drw_setscheme(drw, scheme[SchemeMenu]);
drw_rect(drw, 0, 0, mw, mh, 1, 1);
if (hidemode)
strcpy(modetext, "");
if (prompt && *prompt) {
if (colorprompt) {
drw_setscheme(drw, scheme[SchemePrompt]);
@ -715,8 +720,10 @@ drawmenu(void)
drw_text(drw, mw - TEXTW(numbers) - TEXTW(modetext), 0, TEXTW(numbers), bh, lrpad / 2, numbers, 0, False);
}
drw_setscheme(drw, scheme[SchemeMode]);
drw_text(drw, mw - TEXTW(modetext), 0, TEXTW(modetext), bh, lrpad / 2, modetext, 0, False);
if (!hidemode) {
drw_setscheme(drw, scheme[SchemeMode]);
drw_text(drw, mw - TEXTW(modetext), 0, TEXTW(modetext), bh, lrpad / 2, modetext, 0, False);
}
drw_map(drw, win, 0, 0, mw, mh);
}

View file

@ -110,6 +110,7 @@ ResourcePref resources[] = {
{ "maxhist", INTEGER, &maxhist },
{ "hidematchcount", INTEGER, &hidematchcount },
{ "hidehighlight", INTEGER, &hidehighlight },
{ "hidemode", INTEGER, &hidemode },
{ "histnodup", INTEGER, &histnodup },
{ "casesensitive", INTEGER, &casesensitive },
{ "imagesize", INTEGER, &imagesize },