From d3fe43167c7d96036c8c037ef1b4e03b448efbe7 Mon Sep 17 00:00:00 2001 From: pseudometa <73286100+chrisgrieser@users.noreply.github.com> Date: Fri, 15 Sep 2023 15:49:36 +0200 Subject: fix: `q` keymap in ConformInfo and `codespell` exit codes (#53) * fix: `codespell` error when trying to fix ambiguous misspelling * fix: delay when having a keymap with `q` as operator --- lua/conform/formatters/codespell.lua | 1 + lua/conform/health.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'lua/conform') diff --git a/lua/conform/formatters/codespell.lua b/lua/conform/formatters/codespell.lua index ca07415..88e0109 100644 --- a/lua/conform/formatters/codespell.lua +++ b/lua/conform/formatters/codespell.lua @@ -11,4 +11,5 @@ return { "--write-changes", "--check-hidden", -- conform's temp file is hidden }, + exit_codes = { 0, 65 }, -- code 65 is given when trying to format an ambiguous misspelling } diff --git a/lua/conform/health.lua b/lua/conform/health.lua index 6a12eab..473e8fa 100644 --- a/lua/conform/health.lua +++ b/lua/conform/health.lua @@ -156,7 +156,7 @@ M.show_window = function() vim.bo[bufnr].modifiable = false vim.bo[bufnr].modified = false vim.bo[bufnr].bufhidden = "wipe" - vim.keymap.set("n", "q", "close", { buffer = bufnr }) + vim.keymap.set("n", "q", "close", { buffer = bufnr, nowait = true }) vim.keymap.set("n", "", "close", { buffer = bufnr }) vim.api.nvim_create_autocmd("BufLeave", { desc = "Close info window when leaving buffer", -- cgit v1.2.3-70-g09d2