TextBoxの編集モードでカーソル行の上下複製
code:script.js
function copyUpLine(e, obj){
//オプション+上で行を上に複製
if(!(e.altKey && e.shiftKey && e.keyCode === 38) ){ return; }
e.preventDefault();
const selectpoint = obj.selectionStart;
const textbody = obj.value;
const arry = textbody.split('\n');
const textbefore = obj.value.substr(0, obj.selectionStart) ;
const currentLine = (textbefore.match( /\n/g ) || [] ).length;
arry.splice(currentLine,0,tempN);
obj.value = arry.join('\n');
obj.setSelectionRange(selectpoint,selectpoint);
}