Consider this Lua function:
If cursor is at the word end (current position is same as end position) then
editor:WordEndPosition reports position larger by 1. If cursor is inside word, then reported word end position is correct.
The same faulty rule can be observed for