Skip to content

Commit

Permalink
Fix traceback when a syntax file has unicode characters
Browse files Browse the repository at this point in the history
vim.eval returns a str() object on py2, but our internal strings are all unicode().
We use vimsupport.VimExpressionToPythonType to wrap the conversion complexities.
  • Loading branch information
puremourning committed Mar 10, 2016
1 parent 385dae5 commit 953885c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/ycm/syntax_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 )


Expand Down
2 changes: 1 addition & 1 deletion python/ycm/vimsupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ def EscapeForVim( text ):


def CurrentFiletypes():
return vim.eval( "&filetype" ).split( '.' )
return VimExpressionToPythonType( "&filetype" ).split( '.' )


def FiletypesForBuffer( buffer_object ):
Expand Down

0 comments on commit 953885c

Please sign in to comment.