From e5734575636868e31889b1eb1fd1fd8455a3d7f4 Mon Sep 17 00:00:00 2001 From: micbou Date: Thu, 27 Oct 2016 18:23:20 +0200 Subject: [PATCH] Convert buffer name to unicode Fix JumpToLocation tests on Python 2. --- python/ycm/vimsupport.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ycm/vimsupport.py b/python/ycm/vimsupport.py index e94f9421..dffaf627 100644 --- a/python/ycm/vimsupport.py +++ b/python/ycm/vimsupport.py @@ -152,7 +152,7 @@ def BufferIsVisible( buffer_number ): def GetBufferFilepath( buffer_object ): if buffer_object.name: - return buffer_object.name + return 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 ) ) @@ -372,7 +372,7 @@ def TryJumpLocationInOpenedTab( filename, line, column ): for tab in vim.tabpages: for win in tab.windows: - if win.buffer.name == filepath: + if GetBufferFilepath( win.buffer ) == filepath: vim.current.tabpage = tab vim.current.window = win vim.current.window.cursor = ( line, column - 1 )