Jojo-Schmitz/notenames — pull request #2 by heuchi (2014-08-29 15:18:10+00:00)
Title: detect selection if it contains last measure

If the selection includes the last measure, it wasn't detected, because rewind(2) sets the cursor behind the end of the score. Thus cursor.segment == null.

For a demonstration:
1) Open some file (at least 2 measures).
2) Select only the whole last measure.
3) Run the plugin. It will write the names on all notes because it didn't identify the selection correctly.