summaryrefslogtreecommitdiffstats
path: root/status.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2012-01-20 19:10:29 +0000
committerNicholas Marriott <nicm@openbsd.org>2012-01-20 19:10:29 +0000
commite6519d3e279ba12d44633c3162dd183148aea9f0 (patch)
tree56962ea4ee174d3d283fc2907a6c3e7e64a44b03 /status.c
parent299a8fd4a3ced13ed678f888aa1b61484a2b613d (diff)
Add space movement keys for vi mode in the status line from Ben Boeckel.
Diffstat (limited to 'status.c')
-rw-r--r--status.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/status.c b/status.c
index ebfde9ef..041382fb 100644
--- a/status.c
+++ b/status.c
@@ -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) {