Improve syntax highlighting cancelation (close #309)