return ret;
}
-int key_handle_focus(struct cmd_info *ci)
+static int __key_handle_focus(struct cmd_info *ci, int savepoint)
{
/* Handle this in the focus pane, so x,y are irrelevant */
struct pane *p = ci->focus;
if (p->point && !ci->pointp)
ci->pointp = &p->point;
p = p->focus;
+ if (savepoint && p->point)
+ ci->mark = &p->point->m;
}
ci->focus = p;
ci->comm = NULL;
return key_handle(ci);
}
-int key_handle_xy(struct cmd_info *ci)
+int key_handle_focus(struct cmd_info *ci)
+{
+ return __key_handle_focus(ci, 0);
+}
+int key_handle_focus_point(struct cmd_info *ci)
+{
+ return __key_handle_focus(ci, 1);
+}
+
+static int __key_handle_xy(struct cmd_info *ci, int savepoint)
{
/* Handle this in child with x,y co-ords */
struct pane *p = ci->focus;
x -= chld->x;
y -= chld->y;
p = chld;
+ if (savepoint && p->point)
+ ci->mark = &p->point->m;
}
ci->x = x;
ci->y = y;
ci->comm = NULL;
return key_handle(ci);
}
+
+int key_handle_xy(struct cmd_info *ci)
+{
+ return __key_handle_xy(ci, 0);
+}
+int key_handle_xy_point(struct cmd_info *ci)
+{
+ return __key_handle_xy(ci, 1);
+}
int key_handle(struct cmd_info *ci);
int key_handle_focus(struct cmd_info *ci);
int key_handle_xy(struct cmd_info *ci);
+int key_handle_focus_point(struct cmd_info *ci);
+int key_handle_xy_point(struct cmd_info *ci);
int key_lookup(struct map *m, struct cmd_info *ci);
struct command *key_lookup_cmd(struct map *m, char *c);
void key_add(struct map *map, char *k, struct command *comm);
dd->dpy.mode = dd->dpy.next_mode;
dd->dpy.numeric = NO_NUMERIC;
dd->dpy.extra = 0;
- key_handle_focus(&ci);
+ key_handle_focus_point(&ci);
}
static void do_send_mouse(struct pane *p, int x, int y, char *cmd)
dd->dpy.mode = dd->dpy.next_mode;
dd->dpy.numeric = NO_NUMERIC;
dd->dpy.extra = 0;
- key_handle_xy(&ci);
+ key_handle_xy_point(&ci);
}
static void send_mouse(MEVENT *mev, struct pane *p)