Sorry, I oversimplified, I meant to change from old code:
```python
if sm.anchor < sm.currentPos:
    start = sm.positionFromLine(sm.lineFromPosition(sm.anchor))
    end = sm.getLineEndPosition(sm.lineFromPosition(sm.currentPos))
else:
    start = sm.positionFromLine(sm.lineFromPosition(sm.currentPos))
    end = sm.getLineEndPosition(sm.lineFromPosition(sm.anchor))
```
to new code (doesn't need to compare anchor/currentPos locations):
```python
start = sm.positionFromLine(sm.lineFromPosition(sm.selectionStart))
end = sm.getLineEndPosition(sm.lineFromPosition(sm.selectionEnd))
```