Actually return the new grammar, as per the API

Previously, the emitter didn't return the new type of grammar, just an undefined to signal when the grammar changed. This patch makes it so that the type of grammar is returned when the texteditor's grammar changes, as per what the API says it does
Merge pull request #4743 from Kangaroopower/patch-1

Actually return the new grammar, as per the API