From 5d39a5750732f90f15ebcf4448538b455562b873 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Wed, 28 Jul 2021 01:34:14 -0400 Subject: [PATCH] Pad: Delete dead `ace_getFormattedCode()` --- doc/api/editorInfo.md | 1 - src/static/js/ace.js | 1 - src/static/js/ace2_inner.js | 20 -------------------- src/static/js/domline.js | 1 - 4 files changed, 23 deletions(-) diff --git a/doc/api/editorInfo.md b/doc/api/editorInfo.md index 7cbe3fcd0..5a8551eba 100644 --- a/doc/api/editorInfo.md +++ b/doc/api/editorInfo.md @@ -18,7 +18,6 @@ Returns the `rep` object. ## editorInfo.ace_setOnKeyDown(?) ## editorInfo.ace_setNotifyDirty(?) ## editorInfo.ace_dispose(?) -## editorInfo.ace_getFormattedCode(?) ## editorInfo.ace_setEditable(bool) ## editorInfo.ace_execCommand(?) ## editorInfo.ace_callWithAce(fn, callStack, normalize) diff --git a/src/static/js/ace.js b/src/static/js/ace.js index 3471f4421..6a1548f2e 100644 --- a/src/static/js/ace.js +++ b/src/static/js/ace.js @@ -110,7 +110,6 @@ const Ace2Editor = function () { 'importAText', 'focus', 'setEditable', - 'getFormattedCode', 'setOnKeyPress', 'setOnKeyDown', 'setNotifyDirty', diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index afb3b5e7c..536f580e9 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -586,25 +586,6 @@ function Ace2Inner(editorInfo, cssManagers) { outsideNotifyDirty = handler; }; - const getFormattedCode = () => { - if (currentCallStack && !currentCallStack.domClean) { - inCallStackIfNecessary('getFormattedCode', incorporateUserChanges); - } - const buf = []; - if (rep.lines.length() > 0) { - // should be the case, even for empty file - let entry = rep.lines.atIndex(0); - while (entry) { - const domInfo = entry.domInfo; - buf.push((domInfo && domInfo.getInnerHTML()) || - domline.processSpaces(domline.escapeHTML(entry.text), doesWrap) || - ' ' /* empty line*/); - entry = rep.lines.next(entry); - } - } - return `
${buf.join('
\n
')}
`; - }; - const CMDS = { clearauthorship: (prompt) => { if ((!(rep.selStart && rep.selEnd)) || isCaret()) { @@ -3304,7 +3285,6 @@ function Ace2Inner(editorInfo, cssManagers) { editorInfo.ace_setOnKeyDown = setOnKeyDown; editorInfo.ace_setNotifyDirty = setNotifyDirty; editorInfo.ace_dispose = dispose; - editorInfo.ace_getFormattedCode = getFormattedCode; editorInfo.ace_setEditable = setEditable; editorInfo.ace_execCommand = execCommand; editorInfo.ace_replaceRange = replaceRange; diff --git a/src/static/js/domline.js b/src/static/js/domline.js index 324e13535..032a8d083 100644 --- a/src/static/js/domline.js +++ b/src/static/js/domline.js @@ -224,7 +224,6 @@ domline.createDomLine = (nonEmpty, doesWrap, optBrowser, optDocument) => { }; result.prepareForAdd = writeHTML; result.finishUpdate = writeHTML; - result.getInnerHTML = () => curHTML || ''; return result; };