From 29d20a55b645600feca1b54a13333e598336dad2 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 11 Aug 2014 22:18:16 +0000 Subject: Fix two copy mode problems: 1. In vi mode the selection doesn't include the last character if you moved the cursor up or left. 2. In emacs mode the selection includes the last character if you moved the cursor to the left. From Balazs Kezes. --- window-copy.c | 1 + 1 file changed, 1 insertion(+) (limited to 'window-copy.c') diff --git a/window-copy.c b/window-copy.c index 17f9751b..24f94121 100644 --- a/window-copy.c +++ b/window-copy.c @@ -199,6 +199,7 @@ window_copy_init(struct window_pane *wp) mode_key_init(&data->mdata, &mode_key_tree_emacs_copy); else mode_key_init(&data->mdata, &mode_key_tree_vi_copy); + s->sel.modekeys = keys; data->backing = NULL; -- cgit From 2b79d366528294b80960f3a7ed0923bfa0bdc89c Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 11 Aug 2014 22:39:57 +0000 Subject: No need to repeat other-end more than once, from Juho Pohjala. Also add it to the commands list while here. --- window-copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'window-copy.c') diff --git a/window-copy.c b/window-copy.c index 24f94121..cb8ef57f 100644 --- a/window-copy.c +++ b/window-copy.c @@ -429,7 +429,7 @@ window_copy_key(struct window_pane *wp, struct session *sess, int key) window_pane_reset_mode(wp); return; case MODEKEYCOPY_OTHEREND: - for (; np != 0; np--) + if (np % 2) window_copy_other_end(wp); break; case MODEKEYCOPY_LEFT: -- cgit From 4e956d545a52fe6b8310cfb30a26a89976d55cd9 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 1 Sep 2014 21:50:18 +0000 Subject: Various minor style and spacing nits. --- window-copy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'window-copy.c') diff --git a/window-copy.c b/window-copy.c index cb8ef57f..c9ddf84f 100644 --- a/window-copy.c +++ b/window-copy.c @@ -1498,8 +1498,8 @@ window_copy_copy_pipe(struct window_pane *wp, struct session *sess, void window_copy_copy_selection(struct window_pane *wp, const char *bufname) { - void* buf; - size_t len; + void *buf; + size_t len; buf = window_copy_get_selection(wp, &len); if (buf == NULL) -- cgit