I know this commit is around two years old but I tossed something like this together a quick hack because it was something I wanted as well. You can find it at https://github.com/p4plus2/geany/commit/60344c03b4f985646bbd8eb197238a654e8c...
Is there interest in this sort of feature merged? If so, I can look into making sure its up to the expected standard and then submit a PR.