From 456713e561b73ecfeb0d84d9afff2f3a8cd91cbb Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Wed, 12 Feb 2020 01:19:07 -0500 Subject: Simplify transpose swap --- edit.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/edit.c b/edit.c index 573e549..1f8f170 100644 --- a/edit.c +++ b/edit.c @@ -185,10 +185,9 @@ void edit(size_t id, enum Edit op, wchar_t ch) { break; case EditTranspose: { if (!pos || len < 2) break; if (pos == len) pos--; - wchar_t t = buf[pos]; - buf[pos] = buf[pos - 1]; - buf[pos - 1] = t; - pos++; + wchar_t t = buf[pos - 1]; + buf[pos - 1] = buf[pos]; + buf[pos++] = t; } break; case EditInsert: { -- cgit 1.4.1 ptgroup label='branches'> dontfiles
summary refs log tree commit diff
path: root/bin/cash/libedit/tty.c (unfollow)
Commit message (Expand)Author
2019-02-18Match Sh and Ss as Tag in mdocJune McEnroe
2019-02-18Match statics and typedefs as TagJune McEnroe
2019-02-18Clean up htmlHeaderJune McEnroe
2019-02-18Remove hi line numberingJune McEnroe
2019-02-18Add Tag class to hiJune McEnroe
2019-02-17Generate HTML with hi -n -f html -o anchorJune McEnroe
2019-02-17Add hi -f html -o anchor for line number linksJune McEnroe
2019-02-17Simplify temp trap in upJune McEnroe
2019-02-17Add line numbers to hiJune McEnroe
2019-02-17Always split spans after newlinesJune McEnroe
2019-02-15Color format specifiers light cyan in vimJune McEnroe
2019-02-15Highlight Interp as yellowJune McEnroe
2019-02-15Highlight strings in sh command substitutionsJune McEnroe
2019-02-15Add nmap gpJune McEnroe
2019-02-14Avoid newline when copying URL to pasteboardJune McEnroe
2019-02-13Add forgotten "sixth" book of H2G2June McEnroe