I'm not sure what you mean by "handled
automatically." When visual studio generates new files it puts
newlines at the bottom of every file. Then you go and remove it, and
you want visual studio to add it back? I've never been a big fan of
things that keep adding something that I keep taking away. Not there
are code formatters and stuff that you can use to run over your source
code to fix all the newlines if you want.
I just mean that I want to have an automated system somewhere which silently ensures all files with a .h or .cpp extension end in a new line before they get commited into source control. I can see your point about wanting control over whether the new line is there, but I can't imagine any reason why anyone in my office would deliberately omit it. If nothing else, requiring everyone to remember the presence of an invisible symbol at the end of every file doesn't seem very user friendly...
Are there any code sweepers you'd recommend? We all tend to bit a bit carried away with macros around here, so most C++ analysis tools tend to throw a fit around half way through each file... There's nothing like Visual Assist suddenly deciding to try and auto-complete every word you type in a comment block to brighten your day
For example, if you were using xemacs then the solution could be:
(custom-set-variables '(require-final-newline (quote ask)))
at least that's what I use. Then if I ever do something silly like
trying to save a file without a trailing newline, it asks whether I
really wanted to do that, and one extra keystroke adds the missing
Either your editor has a similar option or you need to get yourself a better editor.
Well, I couldn't find anything in MSVC, but a colleague said he'd found a way of modifying SVN to do it so I guess all's well that ends well.
Thanks for the help guys!