ctrl-t implemented
diff --git a/linenoise.c b/linenoise.c
index 8267ce5..5950d49 100644
--- a/linenoise.c
+++ b/linenoise.c
@@ -225,6 +225,15 @@ static int linenoisePrompt(int fd, char *buf, size_t buflen, const char *prompt)
refreshLine(fd,prompt,buf,len,pos,cols);
}
break;
+ case 20: /* ctrl-t */
+ if (pos > 0 && pos < len) {
+ int aux = buf[pos-1];
+ buf[pos-1] = buf[pos];
+ buf[pos] = aux;
+ if (pos != len-1) pos++;
+ refreshLine(fd,prompt,buf,len,pos,cols);
+ }
+ break;
case 2: /* ctrl-b */
goto left_arrow;
case 6: /* ctrl-f */