Don't update selection on mouse up. This way click on text with hidden syntax works much better.