[Github-comments] [geany/geany] After reformatting the code via CTRL+A and CTRL+1 ("Send selection to") the cursor position is lost (#1913)

Wojciech M. Zabolotny notifications at xxxxx
Wed Aug 1 11:40:16 UTC 2018


Many code editors allow automatic reformatting of the code while typing, without losing the cursor position.
I often use that feature to quickly correct indentation, so that I don't need to do it by hand, or to verify that braces and parantheses are correctly placed and balanced.
Unfortunately, it seems that the only option to reformat C code in geany is to select all the text (CTRL+A) and then to pass it to the external command (astyle or indent) via CTRL+1 (or via Edit->Format->Send selection to in menu), after the command is properly defined.
It would be nice, if geany allowed repositioning the cursor to the original position (or at list to line with the same number if reformatting breaks or combines lines).
Is it possible to write a macro or script that first stores the current line number, then selects all text, passes it to the external command, and finally attempts to put the cursor to the line with the stored number?

-- 
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/1913
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20180801/f48c26e5/attachment.html>


More information about the Github-comments mailing list