From 82e8ae5a491da2c4ecae63792c44a7f784f18740 Mon Sep 17 00:00:00 2001 From: Joe Cheng Date: Thu, 21 Apr 2011 09:44:48 -0700 Subject: [PATCH] Fix performance regression on large documents --- lib/ace/edit_session.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ace/edit_session.js b/lib/ace/edit_session.js index 92b79861..83adf78b 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -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 ||