From 6ddbb407da97737a01f7530acdd37b0e7fa091e6 Mon Sep 17 00:00:00 2001 From: javalsai Date: Sat, 21 Jun 2025 05:25:03 +0200 Subject: [PATCH] fix(ui): custom input not taking all width --- src/ui.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ui.c b/src/ui.c index 0f29967..8b44449 100644 --- a/src/ui.c +++ b/src/ui.c @@ -116,9 +116,12 @@ void ui_update_cursor_focus() { u_char col = bstart.x + VALUES_COL; struct opts_field* ofield = get_opts_ffield(); - col += ofield_display_cursor_col( - ofield, VALUE_MAXLEN - utf8len(g_config->strings.opts_pre) - - utf8len(g_config->strings.opts_post)); + u_char maxlen = VALUE_MAXLEN; + if (ofield->opts > 1) { + maxlen -= utf8len(g_config->strings.opts_pre) + + utf8len(g_config->strings.opts_post); + } + col += ofield_display_cursor_col(ofield, maxlen); if (ofield->opts > 1) col += utf8len(g_config->strings.opts_pre); // rows in here quite bodged