diff options
| author | 2013-07-05 14:41:36 +0000 | |
|---|---|---|
| committer | 2013-07-05 14:41:36 +0000 | |
| commit | 2eaa5dca865d3cdb34fd2e86ced4fb690b7f11d4 (patch) | |
| tree | 713eb3c512b4f387d6d351639ad722679c2df482 /usr.bin/tmux/window-copy.c | |
| parent | zap; it's pointless and badly outdated. (diff) | |
| download | wireguard-openbsd-2eaa5dca865d3cdb34fd2e86ced4fb690b7f11d4.tar.xz wireguard-openbsd-2eaa5dca865d3cdb34fd2e86ced4fb690b7f11d4.zip | |
Act like vi(1) when moving words, from Ben Boeckel.
Diffstat (limited to 'usr.bin/tmux/window-copy.c')
| -rw-r--r-- | usr.bin/tmux/window-copy.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c index c098a0df037..0537de18bac 100644 --- a/usr.bin/tmux/window-copy.c +++ b/usr.bin/tmux/window-copy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window-copy.c,v 1.91 2013/03/25 11:43:33 nicm Exp $ */ +/* $OpenBSD: window-copy.c,v 1.92 2013/07/05 14:41:36 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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,10 @@ 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 (options_get_number(oo, "status-keys") == MODEKEY_VI && px != 0) + px--; + window_copy_update_cursor(wp, px, data->cy); if (window_copy_update_selection(wp)) window_copy_redraw_lines(wp, data->cy, 1); |
