Skip to content

Commit a536798

Browse files
authored
fix: sort extmark_id when serverity are equal (#164)
1 parent 39d4e49 commit a536798

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lua/tiny-inline-diagnostic/cache.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ local function sort_by_severity(diagnostics)
88
local sorted = vim.deepcopy(diagnostics)
99
table.sort(sorted, function(a, b)
1010
return a.severity < b.severity
11+
or (
12+
a.severity == b.severity
13+
and a._extmark_id
14+
and b._extmark_id
15+
and a._extmark_id > b._extmark_id
16+
)
1117
end)
1218
return sorted
1319
end

0 commit comments

Comments
 (0)