[Github-comments] [geany/geany] Transposing mistype chaarcters (#814)

philip r brenan notifications at xxxxx
Tue Jul 30 05:12:00 UTC 2019


Please find below a Geany Lua plugin to perform this useful task:

-- Transpose characters on either side of the cursor
-- Philip R Brenan at gmail.com, www.appaapps.com, 2019
-- Perl Artistic License
local s  = geany.text()
local c  = geany.caret()
local l  = string.len(s)
local s1 = string.sub(s,   1, c-1)
local s2 = string.sub(s,   c, c)
local s3 = string.sub(s, c+1, c+1)
local s4 = string.sub(s, c+2)

geany.text(s1..s3..s2..s4)
geany.caret(c)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/814#issuecomment-516264465
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190729/b107f35a/attachment.html>


More information about the Github-comments mailing list