From 624d956866740a6508e20055526e9999f62d3ff1 Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Tue, 16 May 2000 11:16:20 +0000 Subject: Add a transpose-character function to the editor. From Aaron Schrab. --- enter.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'enter.c') diff --git a/enter.c b/enter.c index 46786199..c8b00f33 100644 --- a/enter.c +++ b/enter.c @@ -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 (); } -- cgit v1.2.3