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

Shift-enter mappings being ignored #367

Closed
2 tasks done
cameron1024 opened this issue Nov 24, 2024 · 3 comments
Closed
2 tasks done

Shift-enter mappings being ignored #367

cameron1024 opened this issue Nov 24, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@cameron1024
Copy link

Make sure you have done the following

  • I have updated to the latest version of blink.cmp
  • I have read the README

Bug Description

Firstly, thanks for the awesome plugin!

Apologies in advance if I've misunderstood the way keybinds are managed. I've found that, in certain files (in particular markdown and typst, but possibly others), the completion window appears after typing common punctuation characters, and so I'd like to be able to press shift+enter to dismiss the window and enter a newline.

But with the configuration I have below, shift+enter behaves exactly the same as just enter by itself (i.e. it accepts the suggestion). Is there a different approach I should be using?

Thanks 😁

Relevant configuration

{
    keymap = {
      preset = "enter",
      ['<Tab>'] = { "select_next", "fallback" },
      ['<S-Tab>'] = { "select_prev", "fallback" },
      ['<C-j>'] = { "select_next", "fallback" },
      ['<C-k>'] = { "select_prev", "fallback" },
      ['<C-c>'] = { "hide", "fallback" },
      ['<S-CR>'] = { "fallback" },
    },
    // ...
  }

neovim version

NVIM v0.11.0-dev Build type: Release LuaJIT 2.1.1713773202 Run "nvim -V1 -v" for more info

blink.cmp version: branch, tag, or commit

v0.5.1

@cameron1024 cameron1024 added the bug Something isn't working label Nov 24, 2024
@Saghen
Copy link
Owner

Saghen commented Nov 24, 2024

Thanks for the kind words! :) Do you mind retesting this on the latest release (v0.6.1 as of writing), and if the bug persists, trying on neovim 0.10? The outputs of :imap <CR> and :imap <S-CR> would also be helpful

I've found that, in certain files (in particular markdown and typst, but possibly others), the completion window appears after typing common punctuation characters

The window triggers due to trigger_characters, provided by the sources. We don't currently support blocking per filetype, but I've just opened an issue for that: #372

@Saghen
Copy link
Owner

Saghen commented Dec 2, 2024

Closing since this seems likely be an issue with your config but lmk if you're still running into this on a fresh config

@Saghen Saghen closed this as not planned Won't fix, can't repro, duplicate, stale Dec 2, 2024
@cameron1024
Copy link
Author

Sorry, just got back to this - I realised the whole issue was actually a tmux issue - when I was checking to see kitty could actually handle <S-CR>, I was checking in a terminal window that wasn't running tmux, but was testing blink inside tmux, which was stopping the keybinding from working at all. The filetype-specific trigger characters seems like a very useful change in the meantime though 😁 Thanks for your effort

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants