In ve.dm.SurfaceFragment#getSelectedLeafNodes we collected only leaf nodes that have a non-empty selection. That means that methods like getSelectedLeafNodes will give a different result if we go from having a collapsed selection in one of the leaf nodes, to an uncollapsed selection. However ve.dm.Selection#setSelection does not emit a context change when this happens, so the previous result sticks.
Example:
Create a document:
* One Two
- Select from the middle of "One" to the left of the "T".
- The only "selected" leaf node is "One", so the VE toolbar shows that the whole selection is a bullet list, and the bullet list button is selected
- Now with shift held, click in the middle of the word "Two" to grow the selection.
- Both "One" and "Two" are now "selected" leaf nodes, so VE should recognised the selection only partially contains a bullet list, and the bullet list button should not be selected
However because of this bug, the previous result is used, and the bullet list button remains selected. This means when it is clicked "One" is de-indented, instead of "Two" being indented.