halirutan / SE-Editor-Buttons

7 stars 7 forks source link

Fix actions not working for text selected from end to start #10

Closed lukas-lang closed 5 years ago

lukas-lang commented 5 years ago

As the title says, this fixes an issue preventing the editor shortcuts from working when the text was selected starting from the end. In this case, s_end < s_start, causing the subsequent code to break. I've added a utility function that reads out both indices from the editor and returns them in ascending order and updated the other functions appropriately.

halirutan commented 5 years ago

@lukas-lang Sounds very reasonable and I definitely trust your judgement here. Thank you very much for taking care of this.