c - 如何将 "unbreak"C 代码与 "Artistic Style"

与 Artistic Style代码格式化程序,我如何实现 --break-after-logical/-xL 的反面,这样如果我有......

if (thisVariable1 == thatVariable1
        || thisVariable2 == thatVariable2
        || thisVariable3 == thatVariable3)
    ...

...我明白了...

if (thisVariable1 == thatVariable1 || thisVariable2 == thatVariable2 || thisVariable3 == thatVariable3)
    ...

最佳答案

艺术风格似乎无法做到这一点。

这很明智,因为它实际上混淆了代码:

  • 垂直对齐通过强调相同的模式和不同的模式来提高易读性(单个 != 将更难在单行中发现)。
  • 它还简化了差异跟踪。

我真的会写:

if  (  thisVariable1   == thatVariable1
    || thisVariable2   == thatVariable2
    || longerVariable3 == thatVariable3 )
    ...

关于c - 如何将 "unbreak"C 代码与 "Artistic Style",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20619831/

相关文章:

)"修改代码样式">java - groovy intelliJ "angle brackets (<>)"修改代码样式

javascript - Visual Studio 2010 坚持在 JavaScript 中插入

iphone - 将(大)数字 "12345"格式化为 "12,345"

html - 不熟悉的 Javascript 语法/hack

asp.net-mvc - Resharper 5 : How do I set the defau

之后强制java xml do">java - 如何在<?xml版本="1.0"编码="UTF-8"?>之后强制java xml do

java - 我可以使用哪个 API 将 int 格式化为 2 位数字?

c++ - Eclipse CDT 中的格式(换行)构造函数初始化程序列表

formatting - 我可以向 mercurial 命令模板添加自定义颜色吗?

python - Gtk3 TextBuffer.serialize() 返回带有格式标签的文本,即