diff --git a/lua/cinnamon/scroll.lua b/lua/cinnamon/scroll.lua index d9b47a4..53f85f7 100644 --- a/lua/cinnamon/scroll.lua +++ b/lua/cinnamon/scroll.lua @@ -125,10 +125,14 @@ H.execute_command = function(command) vim.cmd(utils.keycode(command:sub(2))) elseif command ~= "" then -- Normal mode command + command = utils.keycode(command) if vim.v.count ~= 0 then - vim.cmd("silent! normal! " .. vim.v.count .. utils.keycode(command)) - else - vim.cmd("silent! normal! " .. utils.keycode(command)) + command = vim.v.count .. command + end + -- Indexing the vim.cmd table gives a simpler error message + local success, message = pcall(vim.cmd.normal, { command, bang = true }) + if not success then + vim.notify(message:gsub("^Vim:", ""), vim.log.levels.ERROR) end end elseif type(command) == "function" then