From 403a16b9657ecb52d187f76f93c2937b5b24abd0 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Mon, 21 Jan 2019 21:34:53 -0500 Subject: [PATCH] added mouse actions to accept or dismiss the pick window --- TODO.md | 2 -- src/pick.c | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index e2d7d49..7b17548 100644 --- a/TODO.md +++ b/TODO.md @@ -8,8 +8,6 @@ * registrar: group by hostname or group env var in registrar * registrar: should cleanup invalid windows * tide: gap buffer does not handle UTF-8 currently -* pick: double click should accept clicked item -* pick: middle click should dismiss with no selected item ## BACKLOG diff --git a/src/pick.c b/src/pick.c index 1ec7051..7721e95 100644 --- a/src/pick.c +++ b/src/pick.c @@ -149,6 +149,11 @@ static void xbtnpress(XConf* x, XEvent* e) { ChoiceIdx = Offset + (e->xbutton.y / x->font->height); if (ChoiceIdx >= vec_size(&Choices)) ChoiceIdx = vec_size(&Choices)-1; + } else if (e->xbutton.button == Button2) { + x->running = false; + } else if (e->xbutton.button == Button3) { + x->running = false; + ChoiceIdx = SIZE_MAX; } else if (e->xbutton.button == Button4) { if (Offset > 0) Offset--; } else if (e->xbutton.button == Button5) { -- 2.51.0