Fix performance regression on large documents

This commit is contained in:
Joe Cheng 2011-04-21 09:44:48 -07:00 committed by Fabian Jakobs
commit 82e8ae5a49

View file

@ -1277,7 +1277,11 @@ var EditSession = function(text, mode) {
return screenRows;
}
// For every keystroke this gets called once per char in the whole doc!!
// Wouldn't hurt to make it a bit faster for c >= 0x1100
function isFullWidth(c) {
if (c < 0x1100)
return false;
return c >= 0x1100 && c <= 0x115F ||
c >= 0x11A3 && c <= 0x11A7 ||
c >= 0x11FA && c <= 0x11FF ||