Tag: ace editor

如何将一些已知对象添加到ace编辑器语法检查器?

我们使用ACE编辑器编写在服务器端解释的javascript代码。 所以服务器有一个JavaScript接口,可以执行提交的代码,从外部完成一些任务。 服务器实现一些ACE不知道的新对象。 因此ACE会在代码中使用其中一个未知对象时显示警告。 告诉ACE的正确方法是什么,有一些新的对象,变量和函数? 我已经看了一下worker-javascript.js,但我不想重新实现这些东西(更新ACE会变得更难)。 我可以使用任何界面吗?

在Ace Editor中键入空格会产生特殊字符

我已经在我的网站上安装了ace编辑器,虽然当我在开发环境中测试它时,现在使用相同的代码我遇到输入错误 – 特别是在打空间或删除时。 当我点击空格时,会出现奇怪的字符。 这是我的代码示例和我所看到的图像。 $(function(){ var editor = ace.edit(“editor”); editor.setTheme(“ace/theme/chrome”); editor.getSession().setMode(“ace/mode/html”); }); 有人可以帮忙吗?

Ace Editor能否在一个页面中支持多个代码编辑器?

我正在寻求在一个屏幕上实现一个网络应用程序,该应用程序具有“编码竞争”的样式界面,其中包含2个不同的代码编辑器。 一个将是只读的,另一个将是活动的,并允许用户编辑。 我目前正在使用Ace Editor,我觉得它很棒且易于使用。 但是,这是我的问题。 尝试在单个页面中实现2个不同的编辑器时,我似乎遇到了错误。 未捕获RangeError:超出最大调用堆栈大小 js脚本中的变量“editor”是一个受限制的单词,或者使用什么变量名称无关紧要? 这是我的JS文件中的代码: var editorFirst = ace.edit(“editorFirst”); var editorSecond= ace.edit(“editorSecond”); setupEditor(); function setupEditor() { editorFirst.setTheme(“ace/theme/eclipse”); editorFirst.getSession().setMode(“ace/mode/javascript”); editorFirst.setShowPrintMargin(false); editorFirst.setHighlightActiveLine(true); editorFirst.resize(); editorFirst.setBehavioursEnabled(true); editorFirst.getSession().setUseWrapMode(true); document.getElementById(‘editorFirst’).style.fontSize = ’14px’; editorSecond.setTheme(“ace/theme/eclipse”); editorSecond.getSession().setMode(“ace/mode/javascript”); editorSecond.setShowPrintMargin(false); editorSecond.setHighlightActiveLine(true); editorSecond.resize(); editorSecond.setBehavioursEnabled(true); editorReducer.getSession().setUseWrapMode(true); document.getElementById(‘editorSecond’).style.fontSize = ’14px’; } 这是我的html文件的代码: 在此先感谢您的回复!