Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,12 @@ vim.diagnostic.config {
virtual_lines = false, -- Text shows up underneath the line, with virtual lines

-- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d`
jump = { float = true },
jump = {
on_jump = function(diagnostic, _)
if not diagnostic then return end
vim.diagnostic.open_float { focus = false }
end,
Comment on lines +188 to +191
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked neovim/neovim@dbe17da, which deprecated the option, and it seems like we should do the following if we want to exactly match the previous behaviour:

Suggested change
on_jump = function(diagnostic, _)
if not diagnostic then return end
vim.diagnostic.open_float { focus = false }
end,
on_jump = function(_, bufnr)
vim.diagnostic.open_float {
bufnr = bufnr,
scope = 'cursor',
focus = false,
}
end,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I included if not diagnostic then return end because I saw it in the neovim help :h diagnostic-on-jump-example or see here

I didn't add bufnr or scope because I believe the defaults for those values are the same as what we would pass? Let me know if you want me to add it explicitly though and I'll force push

},
}

vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
Expand Down
2 changes: 1 addition & 1 deletion lua/kickstart/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ local check_version = function()
return
end

if vim.version.ge(vim.version(), '0.11') then
if vim.version.ge(vim.version(), '0.12') then
vim.health.ok(string.format("Neovim version is: '%s'", verstr))
else
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
Expand Down
Loading