diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 2000-05-16 11:16:20 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 2000-05-16 11:16:20 +0000 |
commit | 624d956866740a6508e20055526e9999f62d3ff1 (patch) | |
tree | 9db8f1abbe94d1bfaef816dcd86ad04efef5a0bc /enter.c | |
parent | 37dd1ce603c4bd3a5a5ac7713bbfe11e3679774e (diff) |
Add a transpose-character function to the editor. From Aaron Schrab.
Diffstat (limited to 'enter.c')
-rw-r--r-- | enter.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -484,6 +484,27 @@ int _mutt_enter_string (unsigned char *buf, size_t buflen, int y, int x, goto self_insert; } + case OP_EDITOR_TRANSPOSE_CHARS: + j = buf[curpos]; + if(curpos == 0) + { + buf[curpos] = buf[1]; + buf[1] = j; + } + else if (curpos == lastchar) + { + j = buf[curpos-1]; + buf[curpos-1] = buf[curpos-2]; + buf[curpos-2] = j; + } + else + { + buf[curpos] = buf[curpos-1]; + buf[curpos-1] = j; + } + redraw = M_REDRAW_LINE; + break; + default: BEEP (); } |