Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ctrl+W to delete word in Telescope picker works in 0.1.x but not 0.2.x #71

Open
ebkalderon opened this issue Jun 15, 2024 · 2 comments
Open

Comments

@ebkalderon
Copy link

ebkalderon commented Jun 15, 2024

For some reason, version 0.2.x of smart-open.nvim doesn't allow the use of Ctrl+W (in INSERT mode) within the Telescope picker search box. This is a regression from 0.1.x, which allowed all standard INSERT mode text editing hotkeys to be used to edit the search string. For context, all builtin Telescope pickers and all other third-party Telescope extensions I've ever tried allow for the use of Ctrl+W just fine, among other shortcuts.

It'd be great if support for standard INSERT mode text editing shortcuts could be restored in the 0.2.x branch! In the meantime, I'll probably be sticking with branch = "0.1.x" of smart-open.nvim until this is resolved.

@danielfalk
Copy link
Owner

Yeah I think this was an oversight in choosing a default keybind, but what was worse is you couldn't provide overriding mappings. I've fixed that in main and 0.2.x.

After updating, the following should work as an override:

  mappings = {
    i = {
      ["<C-w>"] = function ()
        vim.api.nvim_input "<c-s-w>"
      end,
    },
  },

In 0.3.x, I will look at changing the default.

@dlvhdr
Copy link
Contributor

dlvhdr commented Oct 20, 2024

Hmm I'm on main and tried the above but I'm getting an error:

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:253: in function <...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:252>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants