繁体   English   中英

使用js beautifier在短函数中避免sublime text3中出现换行

[英]avoid line breaks in sublime text3 in short functions with js beautifier

我将Sublime Text 3与JavaScript Beautify包一起使用。

美化后的代码如下所示:

var jobDimension = ndx.dimension(function(d) {
    return d.status;
});

但我希望它看起来像这样:

var jobDimension = ndx.dimension(function(d) { return d.status; });

这些是可用的设置:

{
    "indent_size": 4,
    "indent_char": " ",
    "indent_level": 0,
    "indent_with_tabs": false,
    "preserve_newlines": true,
    "max_preserve_newlines": 10,
    "jslint_happy": false,
    "space_after_anon_function": false,
    "brace_style": "collapse",
    "keep_array_indentation": false,
    "keep_function_indentation": false,
    "space_before_conditional": true,
    "break_chained_methods": false,
    "eval_code": false,
    "unescape_strings": false,
    "wrap_line_length": 0
}

我尝试了不同的设置,但没有成功。 也许您知道如何使用此软件包或替代方法来实现它。

你可以改变

“ brace_style”:“崩溃”,

“ brace_style”:“无”,

虽然这完全会影响切割线,所以您现在必须自己做。

美化工具的最新版本添加了preserve-inline作为brace-style的选项。 这将使行内(全部在同一行上)支撑块保持不变。 它用作基本设置的修改器:

“ brace_style”:“崩溃,保留内联”,

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM