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, view it on GitHub, or mute the thread.