By default you can’t run a graphic server as root, you can edit the file by terminal with nano, vim, emacs… or let root user run windows with something like this xhost +SI:localuser:root you should do this every system restart, I usually try to use the first option, is safest and fastest.
PS: nano is the easiest editor, to save the file press ctrl+o and enter, to exit crtl+x.
it works for me on ubuntu mate, both with gedit and pluma (gedit fork). mayb u can try to start the filemanager with sudo (nautilus, or the mate fork is caja). or u can try gksudo, however theres a new alternative for gksudo, called polkit. btw what about trying to start it without sudo from terminal, or copy ur user settings to root’s home folder, or delete/rename the existing ones from there? mayb duckduckgo can give u the right answer by the error message… btw caja have a feature, that u can right click in a file browser window, and there u can find something like as open as administrator (try it on a file, and on an empty space as well…) mayb this is an extension that is available for nautilus as well… mayb u can try to reinstall it, or in final case, purge and reinstall… (dont forget about backups, and if u have everything in a safe place, then ur free to experimenting around…)
i think these can be more than enough to find any solution, so good luck, and have fun!