From 55e0e7187b4bbc4775c7e314cbb214be9b8f0560 Mon Sep 17 00:00:00 2001 From: srdusr Date: Sat, 4 Mar 2023 10:38:31 +0200 Subject: Fixed error messages on leaving floating windows on conditional 'q' mapping by using silent command --- lua/user/keys.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/user/keys.lua b/lua/user/keys.lua index 55b7f01..02b466d 100644 --- a/lua/user/keys.lua +++ b/lua/user/keys.lua @@ -33,10 +33,10 @@ map("n", "", "luafile ~/.config/nvim/init.lua | :echom ('Nv map('n', 'q', function() local config = vim.api.nvim_win_get_config(0) if config.relative ~= "" then -- is_floating_window? - return ":close" + return ":silent! close!" elseif vim.o.buftype == 'quickfix' then - return ":close" + return ":quit" elseif vim.o.buftype == 'help' then return ":close" -- cgit v1.2.3