I just posted another approach in there : https://forum.xojo.com/29922-highlight-text-in-a-textarea/0#p245499