clang-format.exe removes trailing new lines at end of file.
However, if no NL is found at EOF one should be added.
Patch by Teodor MICU!
Differential Revision: https://reviews.llvm.org/D37732
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314033
91177308-0d34-0410-b5e6-
96231b3b80d8
\r
string filePath = Vsix.GetDocumentPath(view);\r
var path = Path.GetDirectoryName(filePath);\r
+\r
string text = view.TextBuffer.CurrentSnapshot.GetText();\r
+ if (!text.EndsWith(Environment.NewLine))\r
+ {\r
+ view.TextBuffer.Insert(view.TextBuffer.CurrentSnapshot.Length, Environment.NewLine);\r
+ text += Environment.NewLine;\r
+ }\r
\r
RunClangFormatAndApplyReplacements(text, 0, text.Length, path, filePath, options, view);\r
}\r