From a9ee9909114e92fdb3c7ab3f767fc3f3ece63258 Mon Sep 17 00:00:00 2001 From: Sergei Bulavintsev Date: Fri, 2 Feb 2024 09:30:29 +0300 Subject: [PATCH] feat(nvim): make cheat.sh work with one line words --- nvim/lua/utils/init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nvim/lua/utils/init.lua b/nvim/lua/utils/init.lua index 0d9d4c7..81cf616 100644 --- a/nvim/lua/utils/init.lua +++ b/nvim/lua/utils/init.lua @@ -52,7 +52,12 @@ function M.cheatSheetCommand(detect_language) end end - local command = language .. "/" .. searchPhrase + local command = "" + if searchPhrase == nil then + command = language + else + command = language .. "/" .. searchPhrase + end M.info("cht.sh/" .. command, "Cheat Sheet Query") return ("!curl -s cht.sh/" .. command)