coq_nvim
coq_nvim copied to clipboard
[Question] Have problem when select completion item
Is it possible to auto fill the item in line when use <c-n> or <c-p>? Currently, the content keep unchanged and has the notation like < item >.

And following mapping seems not work:
ino <silent> <expr> <CR> pumvisible() ? (complete_info(["selected"]).selected == -1 ? "\<C-e><CR>" : "\<C-y>") : "\<CR>"
Will get following line when press <cr> if the map added.

My neovim version: NVIM v0.5.1 Build type: Release LuaJIT 2.1.0-beta3
Is it possible to auto fill the item in line when use
<c-n>or<c-p>? Currently, the content keep unchanged and has the notation like< item >.
Sounds like a duplicate of #90.
And following mapping seems not work:
ino <silent> <expr> <CR> pumvisible() ? (complete_info(["selected"]).selected == -1 ? "\<C-e><CR>" : "\<C-y>") : "\<CR>"
Maybe you made a typo when creating the mapping.
Is it possible to auto fill the item in line when use
<c-n>or<c-p>? Currently, the content keep unchanged and has the notation like< item >.Sounds like a duplicate of #90.
And following mapping seems not work:
ino <silent> <expr> <CR> pumvisible() ? (complete_info(["selected"]).selected == -1 ? "\<C-e><CR>" : "\<C-y>") : "\<CR>"Copy
Maybe you made a typo when creating the mapping.
Have same problem when set map as KEYBIND.md said:
ino <silent><expr> <CR> pumvisible() ? (complete_info().selected == -1 ? "\<C-e><CR>" : "\<C-y>") : "\<CR>"
What does :imap <CR> print?

Sounds like https://github.com/tpope/vim-endwise/issues/109.
Does this work for you?
let g:endwise_no_mappings = 1
imap <silent><expr> <CR> (pumvisible() ? (complete_info().selected == -1 ? "\<C-e><CR>" : "\<C-y>") : "\<CR>") .. "\<Plug>DiscretionaryEnd"
Or this:
let g:endwise_no_mappings = 1
imap <silent><expr> <CR> pumvisible() ? (complete_info().selected == -1 ? "\<C-e>\<CR>\<Plug>DiscretionaryEnd" : "\<C-y>") : "\<CR>\<Plug>DiscretionaryEnd"
As per the suggested workaround there, perhaps Coq could make it easier for plugins such as vim-closer/vim-endwise to extend its mappings by not defining them as expr mappings? Something along the lines of:
inoremap <expr> <plug>CustomCoqCR pumvisible() ? (complete_info(['selected']).selected == -1 ? '\<c-e>\<cr>' : '\<c-y>') : '\<cr>'
imap <cr> <plug>CustomCoqCR
Then the <cr> mapping is no longer an expr and vim-closer/vim-endwise don't break it when expanding it.