aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-08-25 00:25:03 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-08-25 00:25:03 +0200
commitd82be078076c040a513fa9fd495e3c36a3fd4828 (patch)
tree2954655a307c64cbac08d60f2e1971d6fc6b162e
parent2d219f1a4bf3f2e8cb3916c63d4765d0781b41f0 (diff)
downloadnncmpp-d82be078076c040a513fa9fd495e3c36a3fd4828.tar.gz
nncmpp-d82be078076c040a513fa9fd495e3c36a3fd4828.tar.xz
nncmpp-d82be078076c040a513fa9fd495e3c36a3fd4828.zip
X11: handle Shift+clicks in the list
-rw-r--r--nncmpp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/nncmpp.c b/nncmpp.c
index 2e7aeb2..c9f3acb 100644
--- a/nncmpp.c
+++ b/nncmpp.c
@@ -2770,6 +2770,13 @@ app_process_left_mouse_click (struct widget *w, int x, int y, int modifiers)
|| row_index >= (int) tab->item_count - tab->item_top)
return false;
+ if (!(modifiers & TERMO_KEYMOD_SHIFT))
+ tab->item_mark = -1;
+ else if (!tab->can_multiselect || tab->item_selected < 0)
+ return false;
+ else if (tab->item_mark < 0)
+ tab->item_mark = tab->item_selected;
+
// TODO: Probably will need to fix up item->top
// for partially visible items in X11.
tab->item_selected = row_index + tab->item_top;