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:
parent
385dae5ad9
commit
953885c449
@ -89,7 +89,7 @@ def SyntaxKeywordsForCurrentBuffer():
|
|||||||
vim.command( 'redir => b:ycm_syntax' )
|
vim.command( 'redir => b:ycm_syntax' )
|
||||||
vim.command( 'silent! syntax list' )
|
vim.command( 'silent! syntax list' )
|
||||||
vim.command( 'redir END' )
|
vim.command( 'redir END' )
|
||||||
syntax_output = vimsupport.GetVariableValue( 'b:ycm_syntax' )
|
syntax_output = vimsupport.VimExpressionToPythonType( 'b:ycm_syntax' )
|
||||||
return _KeywordsFromSyntaxListOutput( syntax_output )
|
return _KeywordsFromSyntaxListOutput( syntax_output )
|
||||||
|
|
||||||
|
|
||||||
|
@ -500,7 +500,7 @@ def EscapeForVim( text ):
|
|||||||
|
|
||||||
|
|
||||||
def CurrentFiletypes():
|
def CurrentFiletypes():
|
||||||
return vim.eval( "&filetype" ).split( '.' )
|
return VimExpressionToPythonType( "&filetype" ).split( '.' )
|
||||||
|
|
||||||
|
|
||||||
def FiletypesForBuffer( buffer_object ):
|
def FiletypesForBuffer( buffer_object ):
|
||||||
|
Loading…
Reference in New Issue
Block a user