在ACE编辑器中更改行高?

rak*_*btg 2 javascript ace-editor

你如何改变ace编辑器的行高?

在此输入图像描述

有没有API可以做到这一点?同时增加线高也应该增加沟槽高度和光标高度,但是从它们的文档中看起来似乎缺失了.

虽然我写的没有运气,

editor.setOptions({
    lineHeight: "40px"
});
Run Code Online (Sandbox Code Playgroud)

我做了一些CSS hack,但它又打破了编辑器布局

div.ace_gutter-cell, div.ace_line {
    padding-top: 10px;
    padding-bottom: 10px;
    height: 20px !important; 
    /* border: 1px solid #ccc; */
}
Run Code Online (Sandbox Code Playgroud)

a u*_*ser 6

您可以使用

editor.container.style.lineHeight = 2
editor.renderer.updateFontSize()
Run Code Online (Sandbox Code Playgroud)

类似于fontSize选项的功能https://github.com/ajaxorg/ace/blob/v1.2.3/lib/ace/virtual_renderer.js#L1703-L1710