diff options
author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-06-05 17:12:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-05 17:12:55 -0700 |
commit | 36802b895f6c426c37e84a0ade3f64bfcf2eb842 (patch) | |
tree | 156bace1f4962dc0a10049a0df7abc86a33ef67d /runtime/lua/vim/lsp/diagnostic.lua | |
parent | f214c19e2b463c88b3c8320346fcb0b050617fb1 (diff) | |
parent | 15abde1676575cd4b938087b4fe7bed5d7182951 (diff) | |
download | rneovim-36802b895f6c426c37e84a0ade3f64bfcf2eb842.tar.gz rneovim-36802b895f6c426c37e84a0ade3f64bfcf2eb842.tar.bz2 rneovim-36802b895f6c426c37e84a0ade3f64bfcf2eb842.zip |
Merge pull request #14730 from mjlbach/feature/open_loclist_on_win
fix(lsp): set_loclist should target current win
Diffstat (limited to 'runtime/lua/vim/lsp/diagnostic.lua')
-rw-r--r-- | runtime/lua/vim/lsp/diagnostic.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua index ebd5773d6e..66a7e39749 100644 --- a/runtime/lua/vim/lsp/diagnostic.lua +++ b/runtime/lua/vim/lsp/diagnostic.lua @@ -1202,6 +1202,8 @@ function M.set_loclist(opts) local open_loclist = if_nil(opts.open_loclist, true) + local win_id = vim.api.nvim_get_current_win() + local bufnr = vim.api.nvim_get_current_buf() local buffer_diags = M.get(bufnr, opts.client_id) @@ -1232,7 +1234,7 @@ function M.set_loclist(opts) table.sort(items, function(a, b) return a.lnum < b.lnum end) - util.set_loclist(items) + util.set_loclist(items, win_id) if open_loclist then vim.cmd [[lopen]] end |