diff --git a/lua/noice/util/hacks.lua b/lua/noice/util/hacks.lua index 82fe83db..54511f64 100644 --- a/lua/noice/util/hacks.lua +++ b/lua/noice/util/hacks.lua @@ -18,7 +18,6 @@ end function M.enable() M.reset_augroup() M.fix_incsearch() - M.fix_input() M.fix_redraw() M.fix_cmp() M.fix_vim_sleuth() @@ -142,68 +141,6 @@ function M.fix_redraw() end) end ----@see https://github.com/neovim/neovim/issues/20311 -M.before_input = false -function M.fix_input() - local function wrap(fn, skip, redirect) - return function(...) - if skip and skip(...) then - return fn(...) - end - - local Manager = require("noice.message.manager") - - -- do any updates now before blocking - M.before_input = true - Router.update() - - if redirect then - require("noice.ui").redirect() - end - - if not redirect then - M.hide_cursor() - end - - ---@type boolean, any - local ok, ret = pcall(fn, ...) - - if not redirect then - M.show_cursor() - end - - -- clear any message right after input - Manager.clear({ event = "msg_show", kind = { "echo", "echomsg", "" } }) - - M.before_input = false - if ok then - return ret - end - error(ret) - end - end - - local function skip(expr) - return expr ~= nil - end - local getchar = vim.fn.getchar - local getcharstr = vim.fn.getcharstr - local inputlist = vim.fn.inputlist - -- local confirm = vim.fn.confirm - - vim.fn.getchar = wrap(vim.fn.getchar, skip) - vim.fn.getcharstr = wrap(vim.fn.getcharstr, skip) - vim.fn.inputlist = wrap(vim.fn.inputlist, nil) - -- vim.fn.confirm = wrap(vim.fn.confirm, nil) - - table.insert(M._disable, function() - vim.fn.getchar = getchar - vim.fn.getcharstr = getcharstr - vim.fn.inputlist = inputlist - -- vim.fn.confirm = confirm - end) -end - -- Fixes cmp cmdline position function M.fix_cmp() M.on_module("cmp.utils.api", function(api) diff --git a/lua/noice/util/init.lua b/lua/noice/util/init.lua index e8895589..925b2dba 100644 --- a/lua/noice/util/init.lua +++ b/lua/noice/util/init.lua @@ -210,7 +210,6 @@ function M.is_blocking(opts) local reason = opts.blocking and mode.blocking and "blocking" or opts.mode and blocking_mode and ("mode:" .. mode.mode) - or opts.input and Hacks.before_input and "input" or opts.redraw and Hacks.inside_redraw and "redraw" or #require("noice.ui.cmdline").cmdlines > 0 and "cmdline" or nil