-
Notifications
You must be signed in to change notification settings - Fork 411
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
tab key will freeze nvim #226
Comments
I just update this plugin , a new problem appears . The same stpes , nvim report a error "E5108: Error executing lua ...pos/github.com/hrsh7th/nvim-cmp/lua/cmp/utils/keymap.lua:163: Vim:E121: Undefined variable: Tab" |
@krisfans Thank you for your report. It's very insightful. Sorry for annoying but Could you check with the following debug codes? -- keymap.lua:L162
misc.set(_G, { 'cmp', 'utils', 'keymap', 'evacuate', 'expr' }, function(mode, lhs, rhs)
return keymap.t(keymap.recursive(mode, lhs, vim.api.nvim_eval(rhs)))
end) ↓↓↓ misc.set(_G, { 'cmp', 'utils', 'keymap', 'evacuate', 'expr' }, function(mode, lhs, rhs)
print(rhs)
return keymap.t(keymap.recursive(mode, lhs, vim.api.nvim_eval(rhs)))
end) |
|
Thank you so much for looking into this. I think I run into a similar issue here: from my local cmp = require'cmp'
cmp.setup({
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
mapping = {
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
['<C-j>'] = cmp.mapping.confirm({ select = true }),
['<TAB>'] = cmp.mapping.confirm({ select = true }), -- removing this line fixes the issue
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'vsnip' },
{ name = 'buffer' },
}
}) In insert mode, press |
@rti Thank you for pointing me it. Unfortunately, I can't reproduce the issue. |
Sorry. Apparently I was hiding the most interesting part of my Yes, I am on the latest revision (cc21a61). Nvim 0.5.1. The issue seems to be triggered by me configuring Minimal local cmd = vim.cmd
local call = vim.call
local fn = vim.fn
local scopes = {o = vim.o, b = vim.bo, w = vim.wo}
local function opt(scope, key, value)
scopes[scope][key] = value
if scope ~= 'o' then scopes['o'][key] = value end
end
opt('o', 'completeopt', 'menu,menuone,noselect')
local install_path = fn.stdpath('data') .. '/site/autoload/'
local install_file = install_path .. 'plug.vim'
if fn.empty(fn.glob(install_file)) > 0 then
cmd[[echom 'Installing vim-plug']]
fn.system({'mkdir', '-p', install_path})
fn.system({
'curl',
'-fLo',
install_file,
'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
})
end
local Plug = fn['plug#']
call('plug#begin', '~/.config/nvim/plugged')
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-vsnip'
Plug 'hrsh7th/vim-vsnip'
call('plug#end')
local cmp = require'cmp'
cmp.setup({
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
mapping = {
['<TAB>'] = cmp.mapping.confirm({ select = true }),
},
sources = {
{ name = 'vsnip' },
}
})
cmd[[imap <expr> <Tab> vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : '<Tab>']] Load with |
It's reproduced. Thank you. I will tackle it. |
Awesome. Indeed. It is fixed. My Thank you so much ❤️ |
* WIP * WIP * Fix #226 * Insert text * Emulate vim native * テキトウ * Tekito * Move scrollbar impl * aaa * Ignore unexpected event * fix * fix scroll * Refactor (conflict...) * Fix bug * Positive integer * Refactor a bit * Fix for pumheight=0 * fx * Improve matching highlight * Improve colorscheme handling * fmt * Add cmp.visible * Fix pum pos * ABBR_MARGIN * Fix cel calculation * up * refactor * fix * a * a * compat * Remove current completion state * Fix ghost text * Add feature toggle * highlight customization * Update * Add breaking change announcement * Add README.md * Remove unused function * extmark ephemeral ghost text * Support native comp * Fix docs pos * a * Remove if native menu visible * theme async * Improvement idea: option to disables insert on select item (#240) * use ghost text instead of insertion on prev/next item * add disables_insert_on_selection option * move disable_insert_on_select option as argumet on * update README * use an enum behavior to disable insert on select * Adopt contribution * Preselect * Improve * Change configuration option * a * Improve * Improve * Implement proper <C-e> behavior to native/custom * Support <C-c> maybe * Improve docs view * Improve * Avoid syntax leak * TODO: refactor * Fix * Revert win pos * fmt * ghost text remaining * Don't use italic by default * bottom * dedup by label * Ignore events * up * Hacky native view partial support * up * perf * improve * more cache * fmt * Fix format option * fmt * recheck * Fix * Improve * Improve * compat * implement redraw * improve * up * fmt/lint * immediate ghost text * source timeout * up * Support multibyte * disable highlight * up * improve * fmt * fmt * fix * fix * up * up * Use screenpos * Add undojoin check * Fix height * matcher bug * Fix dot-repeat * Remove undojoin * macro * Support dot-repeat * MacroSafe * Default item count is 200 * fmt Co-authored-by: Eric Puentes <[email protected]>
Hello I ran into that issue today, when i press the TAB key without the the cmp popup, my neovim do freeze, filling the log file with
my nvim version is v0.5.1 |
I'll try it with minimal config. |
I think I'm encountering the same issue. I use In my case, it is a regression. Bisecting shows that 5fe7dc1 is the first bad commit. |
Please minimal reproduction configuration... |
Use this init.vim: lua << EOF
local cmp = require('cmp')
cmp.setup {
mapping = {
['<c-n>'] = cmp.mapping.select_next_item(),
},
}
EOF This assumes cmp is already loaded, so if it isn't already available in To test it on my end, I made a temporary directory containing the following:
Then, I ran Nvim should freeze when typing This is probably reproducible with any config that binds |
Same Isssue persists for neovim for latest commit. |
I can't reproduce the issue with the following configuration. I can't fix if the user doesn't provide minimal reproducible configuration. if has('vim_starting')
set encoding=utf-8
endif
scriptencoding utf-8
if &compatible
set nocompatible
endif
let s:plug_dir = expand('/tmp/plugged/vim-plug')
if !filereadable(s:plug_dir .. '/plug.vim')
execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir)
end
execute 'set runtimepath+=' . s:plug_dir
call plug#begin(s:plug_dir)
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-buffer'
call plug#end()
lua <<EOF
local cmp = require("cmp")
cmp.setup({
mapping = {
['<c-n>'] = cmp.mapping.select_next_item(),
['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
['<C-y>'] = cmp.mapping.confirm({ select = true }),
},
sources = {
{ name = 'buffer' }
}
})
EOF |
Sorry... reproduced. |
The issue is stil present (i did update to latest) with:
and with:
Same return in the log, it fill the log in an endless loop with I recorded the log just before it strat to write that line endlessly: https://pastebin.com/dfUP8HEd |
What is the HighlightMatchingPairs? |
From neovim sourcecode |
see hrsh7th/vim-vsnip#214
The text was updated successfully, but these errors were encountered: