在 ACE 编辑器中删除自动换行偏移量
Remove word-wrap offset in ACE editor
我需要删除在 ACE 编辑器中换行后自动创建的偏移量 4“ ”
我尝试使用 editor.setTabSize(0)
,效果也很好,但后来我无法使用 TAB 来识别代码,因为它会将 "undefined" 抛入代码中。我在 ACE 网页上搜索,但没有那样的东西,当搜索论坛时,它用 setBehaviosrEnabled
告诉了一些东西,但那也没有用
知道如何去掉这 4 个空格吗?
问题:
代码:
var editor = ace.edit("edittext");
editor.setOptions({
maxLines: Infinity
});
editor.getSession().setUseWrapMode(true);
editor.setBehavioursEnabled(false);
editor.renderer.setOption('showLineNumbers', false);
editor.setTheme("ace/theme/xcode");
这个由ace中的indentedSoftWrap设置控制,你可以通过运行
关闭它
editor.setOption("indentedSoftWrap", false);
行为设置完全无关并控制右括号和标签的自动插入。
所以你上面的代码会变成
var editor = ace.edit("edittext");
editor.setOptions({
maxLines: Infinity, // this is going to be very slow on large documents
useWrapMode: true, // wrap text to view
indentedSoftWrap: false,
behavioursEnabled: false, // disable autopairing of brackets and tags
showLineNumbers: false, // hide the gutter
theme: "ace/theme/xcode"
});
我需要删除在 ACE 编辑器中换行后自动创建的偏移量 4“ ”
我尝试使用 editor.setTabSize(0)
,效果也很好,但后来我无法使用 TAB 来识别代码,因为它会将 "undefined" 抛入代码中。我在 ACE 网页上搜索,但没有那样的东西,当搜索论坛时,它用 setBehaviosrEnabled
告诉了一些东西,但那也没有用
知道如何去掉这 4 个空格吗?
问题:
代码:
var editor = ace.edit("edittext");
editor.setOptions({
maxLines: Infinity
});
editor.getSession().setUseWrapMode(true);
editor.setBehavioursEnabled(false);
editor.renderer.setOption('showLineNumbers', false);
editor.setTheme("ace/theme/xcode");
这个由ace中的indentedSoftWrap设置控制,你可以通过运行
关闭它editor.setOption("indentedSoftWrap", false);
行为设置完全无关并控制右括号和标签的自动插入。
所以你上面的代码会变成
var editor = ace.edit("edittext");
editor.setOptions({
maxLines: Infinity, // this is going to be very slow on large documents
useWrapMode: true, // wrap text to view
indentedSoftWrap: false,
behavioursEnabled: false, // disable autopairing of brackets and tags
showLineNumbers: false, // hide the gutter
theme: "ace/theme/xcode"
});