Skip to content

Commit

Permalink
Fix off-by-one error with location list diags
Browse files Browse the repository at this point in the history
  • Loading branch information
Valloric committed Jun 9, 2014
1 parent 7afcb4b commit afbc786
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/ycm/vimsupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def ConvertDiagnosticToQfFormat( diagnostic ):
# line/column numbers are 1 or 0 based in its various APIs. Here, it wants
# them to be 1-based.
location = diagnostic[ 'location' ]
line_num = location[ 'line_num' ] + 1
line_num = location[ 'line_num' ]

# libclang can give us diagnostics that point "outside" the file; Vim borks
# on these.
Expand All @@ -216,7 +216,7 @@ def ConvertDiagnosticToQfFormat( diagnostic ):
return {
'bufnr' : GetBufferNumberForFilename( location[ 'filepath' ] ),
'lnum' : line_num,
'col' : location[ 'column_num' ] + 1,
'col' : location[ 'column_num' ],
'text' : ToUtf8IfNeeded( diagnostic[ 'text' ] ),
'type' : diagnostic[ 'kind' ][ 0 ],
'valid' : 1
Expand Down

0 comments on commit afbc786

Please sign in to comment.