2

I just installed vim-autoformat and astyle to format my c/c++ code inside vim. Everything seems to work, but it puts a newline to the end of the file everytime I run it. Even if there is one (or multiple). I tried to find the option in astyle -h and search the web, but didn't find anything. What do I do?

Jakub Žitný
  • 962
  • 1
  • 9
  • 38
  • temporary hack: write wrapper calling astyle and [trimming whitespace](http://stackoverflow.com/questions/7495932/how-can-i-trim-blank-lines-at-the-end-of-file-in-vim) – amdixon Nov 16 '13 at 07:00
  • So... if you run astyle 5 times you end up with 5 blank lines at the end of the buffer? Or 5 EOL chars at the end of the last line? – romainl Nov 16 '13 at 07:47
  • I'll try it.. and @romainl Yes. – Jakub Žitný Nov 16 '13 at 08:07

1 Answers1

1

It looks like it's a bug in astyle that's been fixed. See http://astyle.sourceforge.net/subversion.html for help getting the latest development version. I'm using version 2.05 beta and it seems to be working correctly now.

rsarson
  • 95
  • 2
  • 7