mirror of
https://github.com/Smaug123/nix-dotfiles
synced 2025-10-06 15:08:41 +00:00
Fix
This commit is contained in:
@@ -143,6 +143,17 @@ function ChangeToCurrentDirectory()
|
||||
vim.cmd(":pwd")
|
||||
end
|
||||
|
||||
local function close_loclist_if_orphaned()
|
||||
local win = vim.fn.expand("<afile>")
|
||||
vim.fn.win_execute(win, "lclose")
|
||||
end
|
||||
|
||||
-- Set up an autocmd using the nvim_create_autocmd API
|
||||
vim.api.nvim_create_autocmd("WinClosed", {
|
||||
pattern = "*",
|
||||
callback = close_loclist_if_orphaned,
|
||||
})
|
||||
|
||||
local status, whichkey = pcall(require, "which-key")
|
||||
if status then
|
||||
local pickers = require("telescope.pickers")
|
||||
|
@@ -40,7 +40,7 @@ require("lspconfig").pyright.setup(coq.lsp_ensure_capabilities({
|
||||
vim.lsp.diagnostic.on_publish_diagnostics(...)
|
||||
|
||||
local window = vim.api.nvim_get_current_win()
|
||||
vim.diagnostic.setloclist({ open_loclist = false })
|
||||
vim.diagnostic.setloclist({ open_loclist = true })
|
||||
vim.api.nvim_set_current_win(window)
|
||||
end,
|
||||
},
|
||||
@@ -59,7 +59,9 @@ require("lspconfig").nil_ls.setup(coq.lsp_ensure_capabilities({
|
||||
function ToggleLocList()
|
||||
local winid = vim.fn.getloclist(0, { winid = 0 }).winid
|
||||
if winid == 0 then
|
||||
local window = vim.api.nvim_get_current_win()
|
||||
vim.cmd.lopen()
|
||||
vim.api.nvim_set_current_win(window)
|
||||
else
|
||||
vim.cmd.lclose()
|
||||
end
|
||||
|
Reference in New Issue
Block a user