diff options
author | nicm <nicm> | 2017-11-03 14:23:44 +0000 |
---|---|---|
committer | nicm <nicm> | 2017-11-03 14:23:44 +0000 |
commit | ba93a647f1b59d85340f9708ee2ae4fb6f201a64 (patch) | |
tree | fda817ab5da036a45df75f9be1a6a942578b8630 /mode-tree.c | |
parent | 43264dfbf410489b36343a29cc83798a54df67f8 (diff) | |
download | rtmux-ba93a647f1b59d85340f9708ee2ae4fb6f201a64.tar.gz rtmux-ba93a647f1b59d85340f9708ee2ae4fb6f201a64.tar.bz2 rtmux-ba93a647f1b59d85340f9708ee2ae4fb6f201a64.zip |
Change mouse in modes so that one click moves the cursor and a double
click chooses the line.
Diffstat (limited to 'mode-tree.c')
-rw-r--r-- | mode-tree.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mode-tree.c b/mode-tree.c index 4307dbf0..28f97805 100644 --- a/mode-tree.c +++ b/mode-tree.c @@ -726,7 +726,7 @@ mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key, int choice; key_code tmp; - if (*key == KEYC_MOUSEDOWN1_PANE) { + if (KEYC_IS_MOUSE(*key)) { if (cmd_mouse_at(mtd->wp, m, &x, &y, 0) != 0) { *key = KEYC_NONE; return (0); @@ -736,8 +736,11 @@ mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key, return (0); } if (mtd->offset + y < mtd->line_size) { - mtd->current = mtd->offset + y; - *key = '\r'; + if (*key == KEYC_MOUSEDOWN1_PANE || + *key == KEYC_DOUBLECLICK1_PANE) + mtd->current = mtd->offset + y; + if (*key == KEYC_DOUBLECLICK1_PANE) + *key = '\r'; return (0); } } |