Format tweaks to cMonPaste function

This commit is contained in:
mattpass
2020-11-22 15:08:20 +00:00
parent dccfd0a616
commit 4b923dfd7e

View File

@@ -668,14 +668,14 @@ var ICEcoder = {
cMonPaste: function(thisCM, cMinstance, evt, clipboardData) {
// Get text from clipboard, the number of lines (excluding last)
// and so the startLine and endLine and auto-indent for that range
const text = clipboardData.getData('Text');
const num = text.split("\n").length - 1;
const startLine = thisCM.getCursor().line;
const text = clipboardData.getData('Text');
const num = text.split("\n").length - 1;
const startLine = thisCM.getCursor().line;
const endLine = startLine + num;
// Now auto-indent after a 0ms tickover
setTimeout(() => {
parent.ICEcoder.autoIndentLines(startLine, endLine);
}, 0);
setTimeout(() => {
parent.ICEcoder.autoIndentLines(startLine, endLine);
}, 0);
},
// On context menu