diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 073e0781..541942aa 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -367,7 +367,10 @@ return { if require("trouble").is_open() then require("trouble").previous({ skip_groups = true, jump = true }) else - vim.cmd.cprev() + local ok, err = pcall(vim.cmd.cprev) + if not ok then + vim.notify(err, vim.log.levels.ERROR) + end end end, desc = "Previous trouble/quickfix item", @@ -378,7 +381,10 @@ return { if require("trouble").is_open() then require("trouble").next({ skip_groups = true, jump = true }) else - vim.cmd.cnext() + local ok, err = pcall(vim.cmd.cnext) + if not ok then + vim.notify(err, vim.log.levels.ERROR) + end end end, desc = "Next trouble/quickfix item",