From ed9e644ffff2f70cff61648bb836e90b63f72dc0 Mon Sep 17 00:00:00 2001 From: Joao P Dubas Date: Mon, 2 Oct 2023 00:53:09 +0000 Subject: [PATCH] fix(nvim): optionally register which-key prefix --- config/nvim/lua/custom/plugins/init.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/config/nvim/lua/custom/plugins/init.lua b/config/nvim/lua/custom/plugins/init.lua index 622df37..24327b5 100644 --- a/config/nvim/lua/custom/plugins/init.lua +++ b/config/nvim/lua/custom/plugins/init.lua @@ -56,9 +56,12 @@ return { } }, keys = function () - require('which-key').register({ - ['t'] = { name = 'Res[t]', _ = 'which_key_ignore' } - }) + local status_ok, which_key = pcall(require, 'which-key') + if status_ok then + which_key.register({ + ['t'] = { name = 'Res[t]', _ = 'which_key_ignore' } + }) + end return { { 'tr', 'RestNvim', desc = 'Run the request under cursor' }, { 'tp', 'RestNvimPreview', desc = 'Preview the curl command for the request under cursor' },