瀏覽代碼

Minor changes addressing review comments.

Davit Samvelyan 7 年之前
父節點
當前提交
fc745f74b3
共有 3 個文件被更改,包括 4 次插入8 次删除
  1. 3 2
      python/ycm/buffer.py
  2. 0 5
      python/ycm/vimsupport.py
  3. 1 1
      python/ycm/youcompleteme.py

+ 3 - 2
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

+ 0 - 5
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

+ 1 - 1
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()