2016-04-20 61 views

回答

0

没有代码,这是一个有点难以重现[编辑:见下文],但根据the class diagram,你需要与VirtualRenderer互动来改变事物的显示方式。

需要theme来设置代码的样式。 (您可以在the editorTheme-菜单中选择这些)。主题是css(+ js)文件,这会打开使用this trick在您的{\n}元素类之后插入换行符的可能性。

编辑:代码加入

根据\n(正则表达式可以匹配的几个部分)的位置,您可能能够使用

{ 
    token: function(arg1, arg2, arg3, arg4, arg5, arg6, arg7) { 
     return [ 
     "constant", 
     "keyword.operator", 
     (arg3 === '\n') ? "newline" : "variable.parameter", 
     "keyword.operator", 
     "string", 
     "keyword.operator", 
     "variable" 
     ], 
    regex: /([%]?)([=]?)([^|>}]*)([|]?)([^>}]*)([>]?)([^}]*)/ 
} 

,然后有

.ace_newline:after { 
    content:"\a"; 
    white-space: pre; 
} 

在您的自定义主题。

+0

谢谢你的回答。你的类图链接似乎被打破。我考虑过CSS方法,但我不确定它不会破坏ACE的其他逻辑。不得不尝试一下。注意:另请参阅:https://groups.google.com/d/msg/ace-discuss/Xsfb4SSMxAs/KMKXdP-IAwAJ –