fix(diagnostic): sort diagnostics by column (#21457)

Sort diagnostics by column number in quickfix list
This commit is contained in:
tae-soo-kim 2022-12-18 10:17:15 -05:00 committed by GitHub
parent 6b3ae24a70
commit bf9ad5db96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1673,7 +1673,11 @@ function M.toqflist(diagnostics)
end
table.sort(list, function(a, b)
if a.bufnr == b.bufnr then
return a.lnum < b.lnum
if a.lnum == b.lnum then
return a.col < b.col
else
return a.lnum < b.lnum
end
else
return a.bufnr < b.bufnr
end