Sry I meant the if range should be its own followed by another if else block so:

```coffee
if @range?
  if @range.isCollapsed()
    # Anchor
  else
    # formatText 
```
This is because formatText needs range to be defined as well.