fix some wacky stuff

This commit is contained in:
speedie 2023-04-29 16:08:00 +02:00
parent a8b52b38e9
commit ae96605fcd
2 changed files with 4 additions and 5 deletions

View file

@ -280,7 +280,7 @@ drawinput(int x, int y, int w)
// draw input // draw input
drw_setscheme(drw, scheme[SchemeInput]); drw_setscheme(drw, scheme[SchemeInput]);
if (passwd && !hideprompt) { if (passwd) {
censort = ecalloc(1, sizeof(text)); censort = ecalloc(1, sizeof(text));
for (int i = 0; i < strlen(text); i++) for (int i = 0; i < strlen(text); i++)
@ -292,14 +292,14 @@ drawinput(int x, int y, int w)
curpos = TEXTW(censort) - TEXTW(&text[cursor]); curpos = TEXTW(censort) - TEXTW(&text[cursor]);
free(censort); free(censort);
} else if (!passwd && !hideprompt) { } else if (!passwd) {
apply_fribidi(text); apply_fribidi(text);
drw_text(drw, x, y, w, bh, lrpad / 2, isrtl ? fribidi_text : text, 0, pango_input ? True : False); drw_text(drw, x, y, w, bh, lrpad / 2, isrtl ? fribidi_text : text, 0, pango_input ? True : False);
curpos = TEXTW(text) - TEXTW(&text[cursor]); curpos = TEXTW(text) - TEXTW(&text[cursor]);
} }
if ((curpos += lrpad / 2 - 1) < w && !hidecaret && !hideprompt && cursorstate) { if ((curpos += lrpad / 2 - 1) < w && !hidecaret && cursorstate) {
drw_setscheme(drw, scheme[SchemeCaret]); drw_setscheme(drw, scheme[SchemeCaret]);
drw_rect(drw, x + curpos, 2 + (bh - fh) / 2 + y, 2, fh - 4, 1, 0); drw_rect(drw, x + curpos, 2 + (bh - fh) / 2 + y, 2, fh - 4, 1, 0);
} }
@ -474,7 +474,6 @@ drawmenu(void)
x = drawinput(x, y, w); x = drawinput(x, y, w);
} }
if (!hidemode) modeWidth = pango_mode ? TEXTWM(modetext) : TEXTW(modetext); if (!hidemode) modeWidth = pango_mode ? TEXTWM(modetext) : TEXTW(modetext);
// draw the items, this function also calls drawrarrow() and drawlarrow() // draw the items, this function also calls drawrarrow() and drawlarrow()

View file

@ -132,7 +132,7 @@ static int plw = 0;
static int lrpad; // sum of left and right padding static int lrpad; // sum of left and right padding
static int vp; // vertical padding for bar static int vp; // vertical padding for bar
static int sp; // side padding for bar static int sp; // side padding for bar
static int cursorstate = 0; // cursor state static int cursorstate = 1; // cursor state
static size_t cursor; static size_t cursor;
static struct item *items = NULL, *backup_items; static struct item *items = NULL, *backup_items;
static struct item *matches, *matchend; static struct item *matches, *matchend;