Fix setSelectedBufferRanges bug when sels is empty

When i try to expand snippet by tab in some cases was caused exception:
```
Uncaught Error: Passed an empty array to setSelectedBufferRanges 
```