This is actually not a bug, but it was not explained in the Help.
document.selection.count always returns 0 if EmEditor is not in the multiple selection mode.
It can be 1 when there is only one selection while it is in the multiple selection mode. For example, if you try to click at the same Cursor position while pressing CTRL key and move mouse and release the key. Or if there is only one word in a file and press CTRL + SHIFT + A, it should select the word and there will be only one selection.
It is important to distinguish between the normal selection mode and the multiple selection mode, so I will leave the behavior as it is, and will add more explanation to the Help.
Ok. I understood. But I’m thinking how to get top and bottom points of each selection in multiple selection mode. It seems that I can’t find any way which can achieve this. If there is one, I should see it in the description of selection object, right? However, I had better leave that in another thread.