summaryrefslogtreecommitdiffstats
path: root/enter.c
diff options
context:
space:
mode:
Diffstat (limited to 'enter.c')
-rw-r--r--enter.c21
1 files changed, 21 insertions, 0 deletions
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 ();
}