Skip to content

Commit

Permalink
feat: sort results by row and column isntead of just row (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
snezhniylis committed Dec 6, 2021
1 parent 4d0a711 commit 5897b09
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/trouble/providers/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ function M.get(win, buf, cb, options)
provider(win, buf, function(items)
table.sort(items, function(a, b)
if a.severity == b.severity 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.severity < b.severity
end
Expand Down

0 comments on commit 5897b09

Please sign in to comment.