"sudo nano filename.xxx"
If you have to sudo to edit the file you have your protections wrong, you need to fix them, not override them by running editors as root.
To be clear, the Geany team does NOT recommend running Geany as root, it is an IDE and some of the things it does as part of a normal development cycle may be security or other risks when run as root. You have been warned and you are responsible for any damage that may occur.