MostLime commited on
Commit
efe3463
·
verified ·
1 Parent(s): 833c04e

Update Space

Browse files
Files changed (1) hide show
  1. app.js +9 -0
app.js CHANGED
@@ -552,6 +552,15 @@ async function smokeCanvas(m) {
552
  if (r.typed.stats.read > 4) r.ok = false;
553
  S.loops = 3; await run('The old lighthouse keeper climbed the stairs one last time, and');
554
  ed.focus(); ed.setSelectionRange(ed.value.length, ed.value.length); renderCanvas();
 
 
 
 
 
 
 
 
 
555
  return r;
556
  }
557
  async function smoke(models) {
 
552
  if (r.typed.stats.read > 4) r.ok = false;
553
  S.loops = 3; await run('The old lighthouse keeper climbed the stairs one last time, and');
554
  ed.focus(); ed.setSelectionRange(ed.value.length, ed.value.length); renderCanvas();
555
+ const key = (k) => ed.dispatchEvent(new KeyboardEvent('keydown', { key: k, bubbles: true, cancelable: true }));
556
+ const before = ed.value, g0 = CV.ghost, w0 = (g0.match(/^\s*[^\s]+/) || [''])[0];
557
+ key('Tab');
558
+ r.tab = { ok: ed.value === before + w0 && w0.length > 0, added: w0 };
559
+ const g1 = CV.ghost, b1 = ed.value;
560
+ key('ArrowRight');
561
+ r.arrow = { ok: g1.length > 0 && ed.value === b1 + g1, added: g1 };
562
+ if (!r.tab.ok || !r.arrow.ok) r.ok = false;
563
+ await suggestNow(); ed.focus(); ed.setSelectionRange(ed.value.length, ed.value.length); renderCanvas();
564
  return r;
565
  }
566
  async function smoke(models) {