diff --git a/lib/tiolb.js b/lib/tiolb.js index ee60a00..e9111f0 100644 --- a/lib/tiolb.js +++ b/lib/tiolb.js @@ -42,8 +42,8 @@ ev(lb,'mousedown',x=>{ }) let fk=x=>{ let t=x.target - if(bqm){let i=t.selectionStart,v=t.value,c=bqc[x.key];if(x.which>31){bqm=0;d.body.classList.remove('ngn_bq')} - if(c){t.value=v.slice(0,i)+c+v.slice(i);t.selectionStart=t.selectionEnd=i+1;pd(x);return!1}} + if(bqm){let i=t.selectionStart,j=t.selectionEnd,v=t.value,c=bqc[x.key];if(x.which>31){bqm=0;d.body.classList.remove('ngn_bq');log("INS")} + if(c){t.value=v.slice(0,i)+c+v.slice(j);t.selectionStart=t.selectionEnd=i+1;pd(x);return!1}} if (!x.ctrlKey && !x.shiftKey && !x.altKey && !x.metaKey) { if ("`½²^º§ùµ°".indexOf(x.key) > -1) { bqm=1;d.body.classList.add('ngn_bq');pd(x); // ` or other trigger symbol pressed, wait for next key diff --git a/lib/tryapl.js b/lib/tryapl.js index bb4b41e..d19fa14 100644 --- a/lib/tryapl.js +++ b/lib/tryapl.js @@ -96,7 +96,7 @@ function loadTryAPL () { // Continue collecting input lines if accumulated multiline input string has unclosed braces // --- To do --- // Extend Continue to deal with different types of multiline structures - Continue=t=>0<[...t.replace(/'[^']+'/g,"").replace(/⍝.*/g,"")].map(c=>c=="{"?1:c=="}"?-1:0).reduce((a,b)=>a+b) + Continue=t=>0<[...t.replace(/'[^']*'/g,"").replace(/⍝.*/g,"")].map(c=>c=="{"?1:c=="}"?-1:0).reduce((a,b)=>a+b) if (getSessionInput(0)[0]=="\t") { log ("submit multiple lines")