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

disable blink.cmp remaps when telescope prompt is open #104

5 changes: 4 additions & 1 deletion lua/blink/cmp/keymap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ function keymap.setup(opts)
-- from overriding our mappings. We also use InsertEnter to avoid conflicts with keymaps
-- applied on other autocmds, such as LspAttach used by nvim-lspconfig and most configs
vim.api.nvim_create_autocmd('InsertEnter', {
callback = function() keymap.apply_keymap_to_current_buffer(insert_keys_to_commands, snippet_keys_to_commands) end,
callback = function()
if utils.is_special_buffer() then return end
keymap.apply_keymap_to_current_buffer(insert_keys_to_commands, snippet_keys_to_commands)
end,
})
end

Expand Down
2 changes: 2 additions & 0 deletions lua/blink/cmp/trigger/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ function trigger.activate_autocmds()

vim.api.nvim_create_autocmd({ 'CursorMovedI', 'InsertEnter' }, {
callback = function(ev)
if utils.is_special_buffer() then return end

-- we were told to ignore the cursor moved event, so we update the context
-- but don't send an on_show event upstream
if trigger.ignore_next_cursor_moved and ev.event == 'CursorMovedI' then
Expand Down
2 changes: 2 additions & 0 deletions lua/blink/cmp/trigger/signature.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ function trigger.activate_autocmds()
-- check if we've moved outside of the context by diffing against the query boundary
vim.api.nvim_create_autocmd({ 'CursorMovedI', 'InsertEnter' }, {
callback = function(ev)
if utils.is_special_buffer() then return end

-- characters added so let textchanged handle it
if #last_chars ~= 0 then return end

Expand Down