From 953885c4492f4f01f732dbb1e8418e94d74b0f04 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Mon, 7 Mar 2016 22:52:16 +0000 Subject: [PATCH] Fix traceback when a syntax file has unicode characters vim.eval returns a str() object on py2, but our internal strings are all unicode(). We use vimsupport.VimExpressionToPythonType to wrap the conversion complexities. --- python/ycm/syntax_parse.py | 2 +- python/ycm/vimsupport.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ycm/syntax_parse.py b/python/ycm/syntax_parse.py index a4dc7441..e6ea1d52 100644 --- a/python/ycm/syntax_parse.py +++ b/python/ycm/syntax_parse.py @@ -89,7 +89,7 @@ def SyntaxKeywordsForCurrentBuffer(): vim.command( 'redir => b:ycm_syntax' ) vim.command( 'silent! syntax list' ) vim.command( 'redir END' ) - syntax_output = vimsupport.GetVariableValue( 'b:ycm_syntax' ) + syntax_output = vimsupport.VimExpressionToPythonType( 'b:ycm_syntax' ) return _KeywordsFromSyntaxListOutput( syntax_output ) diff --git a/python/ycm/vimsupport.py b/python/ycm/vimsupport.py index 6b8c0a43..115c0e9d 100644 --- a/python/ycm/vimsupport.py +++ b/python/ycm/vimsupport.py @@ -500,7 +500,7 @@ def EscapeForVim( text ): def CurrentFiletypes(): - return vim.eval( "&filetype" ).split( '.' ) + return VimExpressionToPythonType( "&filetype" ).split( '.' ) def FiletypesForBuffer( buffer_object ):