mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
feat(diagnostic): inherit parent 'path' option in open_float (#31273)
Diagnostics sometimes contain stack traces, it's useful being able to use `CTRL-W F` on them to open related files from within the diagnostic window.
This commit is contained in:

committed by
GitHub

parent
165b099fa3
commit
99e7323aa3
@@ -1962,6 +1962,7 @@ function M.open_float(opts, ...)
|
|||||||
opts.focus_id = scope
|
opts.focus_id = scope
|
||||||
end
|
end
|
||||||
local float_bufnr, winnr = vim.lsp.util.open_floating_preview(lines, 'plaintext', opts)
|
local float_bufnr, winnr = vim.lsp.util.open_floating_preview(lines, 'plaintext', opts)
|
||||||
|
vim.bo[float_bufnr].path = vim.bo[bufnr].path
|
||||||
for i, hl in ipairs(highlights) do
|
for i, hl in ipairs(highlights) do
|
||||||
local line = lines[i]
|
local line = lines[i]
|
||||||
local prefix_len = hl.prefix and hl.prefix.length or 0
|
local prefix_len = hl.prefix and hl.prefix.length or 0
|
||||||
|
Reference in New Issue
Block a user