Vi uses the end-of-word character as the cursor location after an 'e' or
'E' motion. Once the motion is complete, we back up one character from
where emacs ends up (one-past-the-word).
---
status.c | 5 +++++
window-copy.c | 6 ++++++
2 files changed, 11 insertions(+)
diff --git a/status.c b/status.c
index de56750..351852e 100644
--- a/status.c
+++ b/status.c
@@ -1193,6 +1193,11 @@ status_prompt_key(struct client *c, int key)
break;
}
+ /* Back up to the end-of-word like vi. */
+ if ((MODEKEY_VI == options_get_number(oo, "status-keys")) &&
+ c->prompt_index)
+ c->prompt_index--;
+
c->flags |= CLIENT_STATUS;
break;
case MODEKEYEDIT_PREVIOUSSPACE:
diff --git a/window-copy.c b/window-copy.c
index 51a8f10..b8286e8 100644
--- a/window-copy.c
+++ b/window-copy.c
@@ -1894,6 +1894,7 @@ void
window_copy_cursor_next_word_end(struct window_pane *wp, const char
*separators)
{
struct window_copy_mode_data *data = wp->modedata;
+ struct options *oo = &wp->window->options;
struct screen *back_s = data->backing;
u_int px, py, xx, yy;
int expected = 1;
@@ -1927,6 +1928,11 @@ window_copy_cursor_next_word_end(struct window_pane *wp,
const char *separators)
expected = !expected;
} while (expected == 0);
+ /* Back up to the end-of-word like vi. */
+ if ((MODEKEY_VI == options_get_number(oo, "status-keys")) &&
+ px)
+ --px;
+
window_copy_update_cursor(wp, px, data->cy);
if (window_copy_update_selection(wp))
window_copy_redraw_lines(wp, data->cy, 1);
--
1.8.2.1
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
tmux-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-users