fix editorhooks typo

and add simple exercise test that would have caught the typo

I introduced a typo in #6927 with the tried-and-true method of

1. get it to work and tested on Windows
2. commit and push something completely different from my real computer