geany/geany — pull request #72 by b4n (2012-09-26 21:09:24+00:00)
Title: Keep caret and anchor position upon indent and unindent

This fixes https://sourceforge.net/tracker/?func=detail&aid=3167355&group_id=153444&atid=787791

However, it seems a little complicated (adds 10 variables), maybe it's overkill, or maybe I overlooked the thing and there is a simpler solution? Though, note that I also indented some code to move it inside an else, so not *all* is functional changes -- only the save/restore of the positions.

Algo here is that the new position on the line after (de) indentation is `O + (L' - L)` if `O > I`, else `O` (where `O` is original offset on the line, `L` and `L'` are line length before and after (de)indentation, and `I` is the original offest of the indentation on the line).

What do you guys think?