Procházet zdrojové kódy

fix(which-key): handle nil command in binding

Fix nil reference error when binding.command is nil by providing
a fallback value.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Bernardo Magri před 1 měsícem
rodič
revize
9883ee5180
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      lua/packages/which-key.lua

+ 1 - 1
lua/packages/which-key.lua

@@ -141,7 +141,7 @@ function which_key.format_hints(bindings, max_width)
             hint = binding.key .. ":" .. desc
             hint = binding.key .. ":" .. desc
         else
         else
             -- Truncate long command names
             -- Truncate long command names
-            local cmd = binding.command
+            local cmd = binding.command or "?"
             if #cmd > 15 then
             if #cmd > 15 then
                 cmd = cmd:sub(1, 12) .. "..."
                 cmd = cmd:sub(1, 12) .. "..."
             end
             end