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

Blink overrides existing insert-mode bindings #39

Closed
julienvincent opened this issue Oct 8, 2024 · 4 comments
Closed

Blink overrides existing insert-mode bindings #39

julienvincent opened this issue Oct 8, 2024 · 4 comments

Comments

@julienvincent
Copy link
Contributor

julienvincent commented Oct 8, 2024

I'm just raising my comment from #20 into a new issue for better tracking.

As of ecb3510 blink now replaces insert-mode keybindings in the buffer even when it isn't active / currently completing.

An example of why this causes a problem is that this breaks map_cr = true behaviour from nvim-autopairs:

When I am editing with nvim-autopairs I expect the following behaviour:

fn main() {|}
// Press <Cr>
fn main() {
  |
}

But this is broken with the following blink config:

require("blink.cmp").setup({
  keymap = {
    accept = { "<Cr>" },
  },
})

Ideally we can find a way to both allow <Cr> to accept without swallowing existing <Cr> mappings on the buffer.

This behaviour pairing works fine on nvim-cmp, so it should at least be possible.


P.S Awesome plugin btw, sorry for making so much noise :)

@Saghen Saghen closed this as completed in 506ea74 Oct 8, 2024
@Saghen
Copy link
Owner

Saghen commented Oct 8, 2024

sorry for making so much noise :)

Don't be! You've been super helpful

@julienvincent
Copy link
Contributor Author

It works! Thanks!

lopi-py pushed a commit to lopi-py/blink.cmp that referenced this issue Oct 10, 2024
lopi-py pushed a commit to lopi-py/blink.cmp that referenced this issue Oct 10, 2024
@benfrain
Copy link

benfrain commented Oct 31, 2024

First time blink user so possibly I'm doing something wrong here but I still seem to see this same issue.

If I enter <CR> here: const operator () => {|} nothing happens. In fact, pressing anywhere in Insert mode does nothing.

My config:

  {
    "saghen/blink.cmp",
    lazy = false, -- lazy loading handled internally
    -- optional: provides snippets for the snippet source
    dependencies = "rafamadriz/friendly-snippets",

    -- use a release tag to download pre-built binaries
    version = "v0.5.0",
    opts = {
      keymap = {
        ["<CR>"] = { "select_and_accept" },
      },
      highlight = {
        use_nvim_cmp_as_default = true,
      },
      nerd_font_variant = "normal",
      accept = { auto_brackets = { enabled = true } },
      trigger = { signature_help = { enabled = true } },
    },
  },

Is there anything obvious I have wrong here?

@Saghen
Copy link
Owner

Saghen commented Nov 1, 2024

You're missing the "fallback" command after your "select_and_accept"

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