aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_defaults.lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim/_defaults.lua')
-rw-r--r--runtime/lua/vim/_defaults.lua16
1 files changed, 12 insertions, 4 deletions
diff --git a/runtime/lua/vim/_defaults.lua b/runtime/lua/vim/_defaults.lua
index 5b964b84a0..26d8729029 100644
--- a/runtime/lua/vim/_defaults.lua
+++ b/runtime/lua/vim/_defaults.lua
@@ -180,12 +180,20 @@ do
--- See |[d-default|, |]d-default|, and |CTRL-W_d-default|.
do
vim.keymap.set('n', ']d', function()
- vim.diagnostic.goto_next({ float = false })
- end, { desc = 'Jump to the next diagnostic' })
+ vim.diagnostic.jump({ count = vim.v.count1, float = false })
+ end, { desc = 'Jump to the next diagnostic in the current buffer' })
vim.keymap.set('n', '[d', function()
- vim.diagnostic.goto_prev({ float = false })
- end, { desc = 'Jump to the previous diagnostic' })
+ vim.diagnostic.jump({ count = -vim.v.count1, float = false })
+ end, { desc = 'Jump to the previous diagnostic in the current buffer' })
+
+ vim.keymap.set('n', ']D', function()
+ vim.diagnostic.jump({ count = math.huge, wrap = false, float = false })
+ end, { desc = 'Jump to the last diagnostic in the current buffer' })
+
+ vim.keymap.set('n', '[D', function()
+ vim.diagnostic.jump({ count = -math.huge, wrap = false, float = false })
+ end, { desc = 'Jump to the first diagnostic in the current buffer' })
vim.keymap.set('n', '<C-W>d', function()
vim.diagnostic.open_float()