The "set ... as default..." functionality is unreliable:
- Right-click on a text file > Open With > Open With
- Select geany, leave "Set selected application as default action of this type of file" unselected, and click OK.
- Geany will now be the default action for text files! (this is not expected)
- Repeat, but select leafpad instead of Geany.
- Geany will still be the default action for text files. (this is expected)
This issue has been around for as long as I can remember.