From 0e9324d012972f8eae6b6183b995dbeb6532a442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sidney=20San=20Mart=C3=ADn?= Date: Tue, 14 Apr 2015 10:23:35 -0700 Subject: [PATCH] Fix spurious warning about missing newline at EOF C requires a newline at the end of any file, and clang may warn if it's missing. Vim always saves one to disk, and we should mimic this. --- python/ycm/vimsupport.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/ycm/vimsupport.py b/python/ycm/vimsupport.py index d6b5d91d..6b168f23 100644 --- a/python/ycm/vimsupport.py +++ b/python/ycm/vimsupport.py @@ -100,7 +100,8 @@ def GetUnsavedAndCurrentBufferData(): continue buffers_data[ GetBufferFilepath( buffer_object ) ] = { - 'contents': '\n'.join( buffer_object ), + # Add a newline to match what gets saved to disk. See #1455 for details. + 'contents': '\n'.join( buffer_object ) + '\n', 'filetypes': FiletypesForBuffer( buffer_object ) }