Skip to content

Commit

Permalink
Merge pull request #4139 from puremourning/changedtick-empty
Browse files Browse the repository at this point in the history
Yet more attempts to catch 'changedtick' returning ''
  • Loading branch information
mergify[bot] authored Mar 20, 2023
2 parents d0657bb + 69e9803 commit 9f4d101
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/ycm/vimsupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,12 @@ def GetCurrentBufferNumber():


def GetBufferChangedTick( bufnr ):
return GetIntValue( f'getbufvar({ bufnr }, "changedtick")' or 0 )
try:
return GetIntValue( f'getbufvar({ bufnr }, "changedtick")' )
except ValueError:
# For some reason, occasionally changedtick returns '' and causes an error.
# In that case, just return 0 rather than spamming an error to the console.
return 0


# Returns a range covering the earliest and latest lines visible in the current
Expand Down Expand Up @@ -929,7 +934,7 @@ def GetBoolValue( variable ):


def GetIntValue( variable ):
return int( vim.eval( variable ) )
return int( vim.eval( variable ) or 0 )


def _SortChunksByFile( chunks ):
Expand Down

0 comments on commit 9f4d101

Please sign in to comment.