From 3a47e719d4dd56d22e138049439a825db1c3d68b Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Sun, 14 Jul 2013 01:51:39 -0400 Subject: [PATCH] Make pads with long lines usable with chrome. - Do not use incorpIfQuick on keyup because it's not ever quick on chrome. Calling incorpIfQuick calls incorporateUserChanges which sets a flag on the current callstack state indicating that the selection has changed (since something was typed). Whenever this flag is set, the event handler will run code to update the selection (and possibly scroll the view as well), which is a very costly operation in webkit browsers. Instead let the user changes be incorporated by the idle worker, scheduling it to run ASAP on keyup. This isn't a perfect solution, but may make pads running on webkit browsers more usable with otherwise fairly unnoticeable changes in the UI. --- src/static/js/ace2_inner.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 97540191a..f53e9de8e 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -3855,7 +3855,7 @@ function Ace2Inner(){ } else if (type == "keyup") { - var wait = 200; + var wait = 0; idleWorkTimer.atLeast(wait); idleWorkTimer.atMost(wait); } @@ -3875,7 +3875,7 @@ function Ace2Inner(){ if ((!specialHandled) && (!thisKeyDoesntTriggerNormalize) && (!inInternationalComposition)) { - if (type != "keyup" || !incorpIfQuick()) + if (type != "keyup") { observeChangesAroundSelection(); }