Mate 16.04 This has happened on ARM and Intel systems, but not yet on my main Desktop, whcih is several upgrades behind since I don't want to reboot it yet. I do recall Libre Office being among the updates I've not installed.
Text, *.py, *.js, etc. all what to open in Libre Office. Opening with "use other application" and checking the "Use for all files of this type" doesn't change the association. Apparently *.h and *.cpp associations remain set for Pluma.
How to fix? Its really annoying, especially on the ARM systems where opening Libre Office is quite slow.
but you will find as you have already tried a number of those suggestions by GUI that you might need to do it by terminal command....its a big list so do it when you have time
sudo update-alternatives --all
Note the link appears to show only one hypen but its two
The easy but takes time method is to right click a file that you want to open using a certain way and specify that way under properties. Right click a .txt file and specify pluma for instance.