【问题标题】:Astyle is adding new lines to the end of the file everytimeAstyle 每次都在文件末尾添加新行
【发布时间】:2013-11-29 16:54:25
【问题描述】:

我刚刚安装了 vim-autoformat 和 astyle 来格式化我在 vim 中的 c/c++ 代码。一切似乎都有效,但每次我运行它时它都会在文件末尾添加一个换行符。即使有一个(或多个)。我试图在 astyle -h 中找到该选项并搜索网络,但没有找到任何东西。我该怎么办?

【问题讨论】:

  • 临时破解:编写包装器调用 astyle 和 trimming whitespace
  • 所以...如果您运行 astyle 5 次,您最终会在缓冲区末尾有 5 个空行?还是最后一行末尾的 5 个 EOL 字符?
  • 我会试试的.. 和@romainl 是的。

标签: c++ c vim autoformatting astyle


【解决方案1】:

看起来这是已修复的 astyle 中的错误。请参阅http://astyle.sourceforge.net/subversion.html 以获得最新开发版本的帮助。我使用的是 2.05 测试版,现在它似乎可以正常工作了。

【讨论】:

  • 确实,最新的svn build没有这个问题。
猜你喜欢
  • 1970-01-01
  • 2013-04-05
  • 1970-01-01
  • 1970-01-01
  • 2023-03-18
  • 1970-01-01
  • 2015-02-16
  • 1970-01-01
  • 2012-04-30
相关资源
最近更新 更多