[wiki] [sites] [dmenu][patch][tsv] update patch || prenev

From: <git_AT_suckless.org>
Date: Sun, 23 Oct 2022 01:24:11 +0200

commit 58cdbb1e8cb0e3fff8623fbdd1debf8c4d55bac1
Author: prenev <an2qzavok_AT_gmail.com>
Date: Sun Oct 23 02:24:02 2022 +0300

    [dmenu][patch][tsv] update patch

diff --git a/tools.suckless.org/dmenu/patches/tsv/dmenu-tsv-20221023-1d2b462.diff b/tools.suckless.org/dmenu/patches/tsv/dmenu-tsv-20221023-1d2b462.diff
new file mode 100644
index 00000000..f5958a3a
--- /dev/null
+++ b/tools.suckless.org/dmenu/patches/tsv/dmenu-tsv-20221023-1d2b462.diff
_AT_@ -0,0 +1,52 @@
+From 3f37b2fc545b90e80658c6489846cca23d936939 Mon Sep 17 00:00:00 2001
+From: prenev <an2qzavok_AT_gmail.com>
+Date: Sun, 23 Oct 2022 02:16:54 +0300
+Subject: [PATCH] tab-separate input lines and only display first parts
+
+---
+ dmenu.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/dmenu.c b/dmenu.c
+index 7cf253b..8eed38a 100644
+--- a/dmenu.c
++++ b/dmenu.c
+_AT_@ -30,6 +30,7 @@ enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */
+
+ struct item {
+ char *text;
++ char *stext;
+ struct item *left, *right;
+ int out;
+ };
+_AT_@ -140,7 +141,7 @@ drawitem(struct item *item, int x, int y, int w)
+ else
+ drw_setscheme(drw, scheme[SchemeNorm]);
+
+- return drw_text(drw, x, y, w, bh, lrpad / 2, item->text, 0);
++ return drw_text(drw, x, y, w, bh, lrpad / 2, item->stext, 0);
+ }
+
+ static void
+_AT_@ -182,7 +183,7 @@ drawmenu(void)
+ }
+ x += w;
+ for (item = curr; item != next; item = item->right)
+- x = drawitem(item, x, 0, textw_clamp(item->text, mw - x - TEXTW(">")));
++ x = drawitem(item, x, 0, textw_clamp(item->stext, mw - x - TEXTW(">")));
+ if (next) {
+ w = TEXTW(">");
+ drw_setscheme(drw, scheme[SchemeNorm]);
+_AT_@ -560,7 +561,8 @@ readstdin(void)
+ die("cannot realloc %zu bytes:", size);
+ if (line[len - 1] == '
')
+ line[len - 1] = '+- items[i].text = line;
++ items[i].text = strdup(line);
++ items[i].stext = strsep(&line, " ");
+ items[i].out = 0;
+ }
+ if (items)
+--
+2.37.3
+
Received on Sun Oct 23 2022 - 01:24:11 CEST

This archive was generated by hypermail 2.3.0 : Sun Oct 23 2022 - 01:24:52 CEST