Browse Source

Merge pull request #3780 from bstaletic/minor-fixes

[READY] Two tiny fixes
mergify[bot] 4 years ago
parent
commit
6e4d1501e8

+ 1 - 1
python/ycm/client/resolve_completion_request.py

@@ -73,7 +73,7 @@ def ResolveCompletionItem( completion_request, item ):
     completion_extra_data = json.loads( item[ 'user_data' ] )
   except KeyError:
     return None
-  except json.JSONDecodeError:
+  except ( TypeError, json.JSONDecodeError ):
     # Can happen with the omni completer
     return None
 

+ 1 - 1
python/ycm/tests/test_utils.py

@@ -38,7 +38,7 @@ BWIPEOUT_REGEX = re.compile(
 GETBUFVAR_REGEX = re.compile(
   '^getbufvar\\((?P<buffer_number>[0-9]+), "(?P<option>.+)"\\)$' )
 MATCHADD_REGEX = re.compile(
-  '^matchadd\\(\'(?P<group>.+)\', \'(?P<pattern>.+)\'\\)$' )
+  '^matchadd\\(\'(?P<group>.+)\', \'(?P<pattern>.+)\', -1\\)$' )
 MATCHDELETE_REGEX = re.compile( '^matchdelete\\((?P<id>\\d+)\\)$' )
 OMNIFUNC_REGEX_FORMAT = (
   '^{omnifunc_name}\\((?P<findstart>[01]),[\'"](?P<base>.*)[\'"]\\)$' )

+ 1 - 1
python/ycm/vimsupport.py

@@ -277,7 +277,7 @@ def GetDiagnosticMatchesInCurrentWindow():
 def AddDiagnosticMatch( match ):
   # TODO: Use matchaddpos which is much faster given that we always are using a
   # location rather than an actual pattern
-  return GetIntValue( f"matchadd('{ match.group }', '{ match.pattern }')" )
+  return GetIntValue( f"matchadd('{ match.group }', '{ match.pattern }', -1)" )
 
 
 def RemoveDiagnosticMatch( match ):