"sudo nano filename.xxx"
I don't agree with the avoid-root-at-all-cost paranoia, but you can minimize the "danger" by running the editor as the actual user that owns the file with `sudo -u`. You can also avoid creating a new file with wrong ownership.
So using the command geany assumes you're logged in as root, and if you are, you shouldn't have permission issues, but if not, you need to "sudo " into geany
So what exactly was the issue?