I can think only of this https://github.com/ajaxorg/ace/commit/473583922ef15371a3106e414e2aa1247311138f. Does it work better?