Editor refactored to OOP and select text first fixed