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.
This commit is contained in:
Ben Jackson 2016-03-07 22:52:16 +00:00
parent 385dae5ad9
commit 953885c449
2 changed files with 2 additions and 2 deletions

View File

@ -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 )

View File

@ -500,7 +500,7 @@ def EscapeForVim( text ):
def CurrentFiletypes():
return vim.eval( "&filetype" ).split( '.' )
return VimExpressionToPythonType( "&filetype" ).split( '.' )
def FiletypesForBuffer( buffer_object ):