FeiyouG / commander.nvim

Create and manage keybindings and commands in a more organized manner, and search them quickly through Telescope

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error if nothing was selected

bugabinga opened this issue · comments

  1. Open Command Center
  2. Type some gibberish until the filtered list list empty
  3. Hit <ENTER>

Alternatively, open Command Center without and bindings added and hit <ENTER>.

E5108: Error executing lua ...mand_center/lua/telescope/_extensions/command_center.lua:151: attempt to index local 'selection' (a nil value)
stack traceback:
        ...mand_center/lua/telescope/_extensions/command_center.lua:151: in function 'run_replace_or_original'
        ...ite/pack/paqs/opt/telescope/lua/telescope/actions/mt.lua:65: in function 'key_func'
        .../site/pack/paqs/opt/telescope/lua/telescope/mappings.lua:242: in function 'execute_keymap'
        [string ":lua"]:1: in main chunk

Telescope + CC config:

telescope.setup {
  extensions = {
    command_center = {
      -- Change what to show on telescope prompt and in which order
      -- Currently support the following three components
      -- Components may repeat
      components = {
        command_center.component.DESCRIPTION,
        command_center.component.KEYBINDINGS,
        -- command_center.component.COMMAND,
      },
      -- Change the separator used to separate each component
      separator = " ",
      -- When set to false,
      -- The description compoenent will be empty if it is not specified
      auto_replace_desc_with_cmd = false,
    }
  }
}

-- Plug Command Center into Telescope
telescope.load_extension('command_center')

Fixed in e3b32c7