I am for ever mistyping pairs of character I tried to write a transpose macro but I could not get it to work Is there a command to transpose the pair of letters on either side of the cursor? I see from the documentation that there is a transpose lines capability but I could not find anything about pairs of characters If there is not such a capability, please could you consider adding one as I would find it very useful <b>Thanks!</b>
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/814
There''s a open bug for this in Scintilla: https://sourceforge.net/p/scintilla/feature-requests/657/ It looks that the developer is not interested in doing it but he's open to others to implement it.
--- 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-232153894
Yeah, could be handy for fixing ytpos.
It could also be done in Geany, it doesn't really need to be done in Scintilla. Just cut the code point before the cursor, move the cursor one code point, and paste after the cursor.
Pull requests are welcome.
--- 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-232236977
…or a plugin probably.
--- 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-232357056
@b4n a plugin just for this? why?
--- 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-232357796
Well, IIUC "just this" requires live transformation of the typed input, a list of replacement rules and a UI to edit that list.
So, why a plugin:
1. because pluggablility is awesome 2. because it's not that tiny actually 3. because plugins are fairly cheap, and not very harder to develop than a core feature
Maybe I'm misunderstanding the feature though. Or maybe you're feeling a plugin is a worse version than a core feature, yet I do not.
--- 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-232359399
I was just thinking of a keybinding to swap the code points either side of cursor which shouldn't need a plugin.
@b4n goes for ytpo autopilot which may/may not be a good idea, but definitely is a plugin.
--- 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-232516255
Oh, that simple of a thing. Sure then, a *Transpose Current Line*-like keybinding for characters would be fine in core.
--- 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-232517147
There is already a keybinding for this: <kbd>BackSpace</kbd> + <kbd>Right</kbd> + <kbd>Correct Second Char</kbd> :)
--- 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-232517343
@codebrainz due to liveware involvement that keybinding often results in the creation of a second tupo :smile:
--- 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-232521036
We should add a keybinding to deal with end of lines in C-like languages too; by pressing two keys you could have it insert a semi-colon _and_ a new line... think of the time savings!
--- 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-232525111
I think like @codebrainz. I was just adding info related to this that I had found, but I'm don't really see the point of having a keybinding just to transpose two chars.
--- 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-235086896
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)
Closed #814.
github-comments@lists.geany.org