diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-09-02 22:45:17 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-09-02 22:45:17 +0000 |
commit | 3b944fe7e847ee5e5741582ed34b702273f0b9ef (patch) | |
tree | 7084de50cb225e99bc6f8f2f69db0ef022bb104b /status.c | |
parent | afd0bd7cb0fcc6ee001d678febf6f6bfa6d8dba8 (diff) | |
download | rtmux-3b944fe7e847ee5e5741582ed34b702273f0b9ef.tar.gz rtmux-3b944fe7e847ee5e5741582ed34b702273f0b9ef.tar.bz2 rtmux-3b944fe7e847ee5e5741582ed34b702273f0b9ef.zip |
Sync OpenBSD patchset 307:
Add a transpose-chars command in edit mode (C-t in emacs mode only). From Kalle
Olavi Niemitalo.
Diffstat (limited to 'status.c')
-rw-r--r-- | status.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: status.c,v 1.114 2009-09-02 00:55:49 tcunha Exp $ */ +/* $Id: status.c,v 1.115 2009-09-02 22:45:17 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -763,7 +763,7 @@ void status_prompt_key(struct client *c, int key) { struct paste_buffer *pb; - char *s, *first, *last, word[64]; + char *s, *first, *last, word[64], swapc; size_t size, n, off, idx; size = strlen(c->prompt_buffer); @@ -933,6 +933,18 @@ status_prompt_key(struct client *c, int key) c->flags |= CLIENT_STATUS; break; + case MODEKEYEDIT_TRANSPOSECHARS: + idx = c->prompt_index; + if (idx < size) + idx++; + if (idx >= 2) { + swapc = c->prompt_buffer[idx - 2]; + c->prompt_buffer[idx - 2] = c->prompt_buffer[idx - 1]; + c->prompt_buffer[idx - 1] = swapc; + c->prompt_index = idx; + c->flags |= CLIENT_STATUS; + } + break; case MODEKEYEDIT_ENTER: if (*c->prompt_buffer != '\0') status_prompt_add_history(c); |