summary refs log tree commit diff
path: root/edit.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-12 01:19:07 -0500
committerJune McEnroe <june@causal.agency>2020-02-12 01:19:07 -0500
commit456713e561b73ecfeb0d84d9afff2f3a8cd91cbb (patch)
tree5febd8532fd17fccd0630ff8469a5fae1216c9d1 /edit.c
parentAdd C-t transpose (diff)
downloadcatgirl-456713e561b73ecfeb0d84d9afff2f3a8cd91cbb.tar.gz
catgirl-456713e561b73ecfeb0d84d9afff2f3a8cd91cbb.zip
Simplify transpose swap
Diffstat (limited to '')
-rw-r--r--edit.c7
1 files 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: {
4a794c56a2052be81fdb50d3da1e87d15d&follow=1'>Simplify Makefile with pattern ruleJune McEnroe 2017-09-27Remove leading blank linesJune McEnroe 2017-09-27Add merge.c to READMEJune McEnroe 2017-09-03Assert client coords are valid after movementJune McEnroe 2017-09-03Relicense AGPLJune McEnroe 2017-09-01Revert "Add client readOnly mode"June McEnroe 2017-09-01Remove clientRemove call from clientCastJune McEnroe 2017-09-01Add client readOnly modeJune McEnroe 2017-08-31Clean up merge toolJune McEnroe 2017-08-31Choose B for tiles with equal modify timesJune McEnroe 2017-08-31Add quick data file merge toolJune McEnroe 2017-08-30Use only foreground color for selecting spawnJune McEnroe 2017-08-29Add four additional spawnsJune McEnroe 2017-08-28Add respawningJune McEnroe 2017-08-26Move license above includesJune McEnroe 2017-08-26Snapshot metadataJune McEnroe 2017-08-26Add meta.c to READMEJune McEnroe 2017-08-26Use MakefileJune McEnroe