Pārlūkot izejas kodu

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.
Sidney San Martín 10 gadi atpakaļ
vecāks
revīzija
0e9324d012
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2 1
      python/ycm/vimsupport.py

+ 2 - 1
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 )
     }