Skip to content

[Bug] <C-w> and throwing error #94

@dmtrKovalenko

Description

@dmtrKovalenko

trying to support to remove a word throwing error

 Error 22:43:05 msg_show.emsg E5108: Error executing lua: ...are/nvim/lazy/smart-open.nvim/lua/smart-open/actions.lua:17: attempt to index local 'selection' (a nil value)
stack traceback:
...are/nvim/lazy/smart-open.nvim/lua/smart-open/actions.lua:17: in function 'key_func'
...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:293: in function <...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:292>
 Error 22:43:06 msg_show.emsg E5108: Error executing lua: ...are/nvim/lazy/smart-open.nvim/lua/smart-open/actions.lua:17: attempt to index local 'selection' (a nil value)
stack traceback:
...are/nvim/lazy/smart-open.nvim/lua/smart-open/actions.lua:17: in function 'key_func'
...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:293: in function <...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:292>
 Error 22:43:06 msg_show.emsg E5108: Error executing lua: ...are/nvim/lazy/smart-open.nvim/lua/smart-open/actions.lua:17: attempt to index local 'selection' (a nil value)
stack traceback:
...are/nvim/lazy/smart-open.nvim/lua/smart-open/actions.lua:17: in function 'key_func'
...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:293: in function <...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:292>
22:43:27 msg_show "lua/telescope-lazy.lua"
22:43:27 msg_show "lua/telescope-lazy.lua" 139L, 5217B written

Which I am getting by using the following telescope setup

require("telescope").setup {
  extensions = {
    smart_open = {
      match_algorithm = "fzf",
      disable_devicons = false,
    },
  },
  defaults = {
    mappings = {
      i = {
        ["<D-'>"] = require("telescope-live-grep-args.actions").quote_prompt(),
        ["<D-i>"] = require("telescope-live-grep-args.actions").quote_prompt {
          postfix = " --iglob ",
        },
        ["<D-e>"] = require("telescope-live-grep-args.actions").quote_prompt {
          postfix = " --fixed-strings",
        },
        ["<C-Down>"] = require("telescope.actions").cycle_history_next,
        ["<C-Up>"] = require("telescope.actions").cycle_history_prev,
        ["<A-Bs>"] = function()
          local keys = vim.api.nvim_replace_termcodes("<C-w>", true, false, true)
          vim.api.nvim_feedkeys(keys, "i", true)
        end,
      },
    },
  },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions