diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-01-20 19:10:30 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-01-20 19:10:30 +0000 |
commit | 52ec8ec91f79b331e1f548cae29f8cf165bc3753 (patch) | |
tree | 7d944ecd7c81b6a962eba087ceea61eeca90e11c /usr.bin/tmux/status.c | |
parent | 8f7384ee0d96759b73de9eaba25407df4c0d452b (diff) |
Add space movement keys for vi mode in the status line from Ben Boeckel.
Diffstat (limited to 'usr.bin/tmux/status.c')
-rw-r--r-- | usr.bin/tmux/status.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c index a02a0664717..9437241b70f 100644 --- a/usr.bin/tmux/status.c +++ b/usr.bin/tmux/status.c @@ -1,4 +1,4 @@ -/* $OpenBSD: status.c,v 1.82 2011/12/01 20:42:31 nicm Exp $ */ +/* $OpenBSD: status.c,v 1.83 2012/01/20 19:10:29 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -978,7 +978,7 @@ status_prompt_key(struct client *c, int key) struct paste_buffer *pb; char *s, *first, *last, word[64], swapc; const char *histstr; - const char *wsep; + const char *wsep = NULL; u_char ch; size_t size, n, off, idx; @@ -1124,8 +1124,12 @@ status_prompt_key(struct client *c, int key) c->prompt_index = idx; c->flags |= CLIENT_STATUS; break; + case MODEKEYEDIT_NEXTSPACE: + wsep = " "; + /* FALLTHROUGH */ case MODEKEYEDIT_NEXTWORD: - wsep = options_get_string(oo, "word-separators"); + if (wsep == NULL) + wsep = options_get_string(oo, "word-separators"); /* Find a separator. */ while (c->prompt_index != size) { @@ -1143,8 +1147,12 @@ status_prompt_key(struct client *c, int key) c->flags |= CLIENT_STATUS; break; + case MODEKEYEDIT_NEXTSPACEEND: + wsep = " "; + /* FALLTHROUGH */ case MODEKEYEDIT_NEXTWORDEND: - wsep = options_get_string(oo, "word-separators"); + if (wsep == NULL) + wsep = options_get_string(oo, "word-separators"); /* Find a word. */ while (c->prompt_index != size) { @@ -1162,8 +1170,12 @@ status_prompt_key(struct client *c, int key) c->flags |= CLIENT_STATUS; break; + case MODEKEYEDIT_PREVIOUSSPACE: + wsep = " "; + /* FALLTHROUGH */ case MODEKEYEDIT_PREVIOUSWORD: - wsep = options_get_string(oo, "word-separators"); + if (wsep == NULL) + wsep = options_get_string(oo, "word-separators"); /* Find a non-separator. */ while (c->prompt_index != 0) { |