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.