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(-) (limited to 'edit.c') 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.0 3166f7e5cbe6'>this commit dontfiles
summary refs log tree commit diff
path: root/bin/cash/libedit/config.h (unfollow)
Commit message (Collapse)Author
2019-02-08Elaborate hi man pageJune McEnroe
2019-02-08Use set for parent in hiJune McEnroe
2019-02-08Switch back to semantic keyword grouping in hiJune McEnroe
2019-02-08Match only the basename in hiJune McEnroe
2019-02-07Add mdoc syntax to hiJune McEnroe
2019-02-07Support multi-line C macros in hiJune McEnroe
2019-02-07Detect .mk files as makeJune McEnroe
2019-02-07Add make syntax to hiJune McEnroe
2019-02-07Add IRC output to hiJune McEnroe
2019-02-07Improve C syntax accuracy and add Format classJune McEnroe
2019-02-07Factor out hi checkJune McEnroe
Fix subexpression bounds check and compile pattends.
2019-02-07Add Escape class to hiJune McEnroe
2019-02-07Add Todo class and parent syntax constraintJune McEnroe