From b1eda652c3d9e43fc0550df3ec95323a54d70847 Mon Sep 17 00:00:00 2001 From: micbou Date: Thu, 23 Nov 2017 01:56:49 +0100 Subject: [PATCH] Normalize buffer filepath On Windows, Vim returns buffer filepaths with forward slashes instead of backward ones if the shellslash option is set. Since we always expect backward slashes from the server, we normalize these paths. --- python/ycm/vimsupport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ycm/vimsupport.py b/python/ycm/vimsupport.py index 1e84f16a..861b6dc8 100644 --- a/python/ycm/vimsupport.py +++ b/python/ycm/vimsupport.py @@ -158,7 +158,7 @@ def BufferIsVisible( buffer_number ): def GetBufferFilepath( buffer_object ): if buffer_object.name: - return ToUnicode( buffer_object.name ) + return os.path.normpath( ToUnicode( buffer_object.name ) ) # Buffers that have just been created by a command like :enew don't have any # buffer name so we use the buffer number for that. return os.path.join( GetCurrentDirectory(), str( buffer_object.number ) )