diff --git a/python/ycm/buffer.py b/python/ycm/buffer.py index 91daa352..281057fb 100644 --- a/python/ycm/buffer.py +++ b/python/ycm/buffer.py @@ -104,5 +104,6 @@ class BufferDict( dict ): def __missing__( self, key ): - value = self[ key ] = Buffer( key, self._user_options ) - return value + # Python does not allow to return assignment operation result directly + new_value = self[ key ] = Buffer( key, self._user_options ) + return new_value diff --git a/python/ycm/vimsupport.py b/python/ycm/vimsupport.py index a37538de..f2d0f0a7 100644 --- a/python/ycm/vimsupport.py +++ b/python/ycm/vimsupport.py @@ -592,11 +592,6 @@ def CurrentFiletypes(): return VimExpressionToPythonType( "&filetype" ).split( '.' ) -def GetBufferFiletypes( bufnr ): - command = 'getbufvar({0}, "&ft")'.format( bufnr ) - return VimExpressionToPythonType( command ).split( '.' ) - - def FiletypesForBuffer( buffer_object ): # NOTE: Getting &ft for other buffers only works when the buffer has been # visited by the user at least once, which is true for modified buffers diff --git a/python/ycm/youcompleteme.py b/python/ycm/youcompleteme.py index e064266e..2a6f667c 100644 --- a/python/ycm/youcompleteme.py +++ b/python/ycm/youcompleteme.py @@ -580,7 +580,7 @@ class YouCompleteMe( object ): # # Note: it is the server's responsibility to determine the frequency of # error/warning/prompts when receiving a FileReadyToParse event, but - # it our responsibility to ensure that we only apply the + # it is our responsibility to ensure that we only apply the # warning/error/prompt received once (for each event). current_buffer.MarkResponseHandled()