<p>Please find below a Geany Lua plugin to perform this useful task:</p>
<p>-- Transpose characters on either side of the cursor<br>
-- Philip R Brenan at gmail.com, <a href="http://www.appaapps.com" rel="nofollow">www.appaapps.com</a>, 2019<br>
-- Perl Artistic License<br>
local s  = geany.text()<br>
local c  = geany.caret()<br>
local l  = string.len(s)<br>
local s1 = string.sub(s,   1, c-1)<br>
local s2 = string.sub(s,   c, c)<br>
local s3 = string.sub(s, c+1, c+1)<br>
local s4 = string.sub(s, c+2)</p>
<p>geany.text(s1..s3..s2..s4)<br>
geany.caret(c)</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/814?email_source=notifications&email_token=AAIOWJ3RRCZZOZEGUFJ5VKDQB7ESBA5CNFSM4BWTFQE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3CZEEI#issuecomment-516264465">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJYKUAJ2J26T22KYKELQB7ESBANCNFSM4BWTFQEQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAIOWJZBSF4XDPM3UDS3PBTQB7ESBA5CNFSM4BWTFQE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3CZEEI.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/814?email_source=notifications\u0026email_token=AAIOWJ3RRCZZOZEGUFJ5VKDQB7ESBA5CNFSM4BWTFQE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3CZEEI#issuecomment-516264465",
"url": "https://github.com/geany/geany/issues/814?email_source=notifications\u0026email_token=AAIOWJ3RRCZZOZEGUFJ5VKDQB7ESBA5CNFSM4BWTFQE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3CZEEI#issuecomment-516264465",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>