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.
This commit is contained in:
Dave Longley 2013-07-14 01:51:39 -04:00
parent d5a3d9d03b
commit 3a47e719d4

View file

@ -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();
}