Closed dylnmc closed 5 years ago
Does the tip MUcomplete does not always insert a new line when I press Enter… in :help mucomplete-tips
solve your issue?
I am wondering how
<cr>
is effectively acting like<c-e>
How <cr>
should behave is described in :help popupmenu-keys
. IMO, Vim does not always behave as described (see, for instance, https://github.com/vim/vim/issues/1653).
it seems to work fine without your plugin.
Can you provide a reproducible example?
hey hey. Indeed, I use the following:
inoremap <expr> <cr> maps#crExpand()
and
function! maps#crExpand()
let l:col = col('.')
let l:pre = pumvisible() ? "\<c-y>" : ''
if (l:col !=# col('$'))
return l:pre."\<cr>"
endif
let l:mps = map(split(&matchpairs, ','), "split(v:val, ':')")
let l:i = -1
let l:bn = bufnr('.')
for l:mp in split(get(g:, 'crIgnores', ''), ',')
let l:i = index(l:mps, split(l:mp, ':'))
if (l:i + 1)
call remove(l:mps, l:i)
endif
endfor
for l:mp in split(getbufvar(l:bn, 'crIgnores', ''), ',')
let l:i = index(l:mps, split(l:mp, ':'))
if (l:i + 1)
call remove(l:mps, l:i)
endif
endfor
let l:mps +=
\ map(split(get(g:, 'crMatchpairs', ''), ','), "split(v:val, ':')") +
\ map(split(getbufvar(l:bn, 'crMatchpairs', ''), ','), "split(v:val, ':')")
let l:i = index(map(copy(l:mps), 'v:val[0]'), getline('.')[l:col - 2])
if (l:i + 1)
return l:pre."\<cr>".l:mps[l:i][1]."\<esc>O"
else
return l:pre."\<cr>"
endif
endfunction
I have now added the l:pre
which is "\<c-y>"
if pumvisible()
, and it works. Thanks.
I thought I had read the entire help, and I did thouroughly read it, but I must have missed this part. Thanks, as always, for your timely and helpful replies and for your assistance.
~dylnmc
p.s. I wrote this function before I knew about filter and some other goody functions, so don't make fun of me /hides\ ;P
Hi! I have been manually using
<c-p>
<c-x><c-p>
<c-x><c-l>
and all that good stuff manually for quite some time now. I decided to give this plugin a whirl again. It's super great! I think that since the last time I used it, there has been a fix for c-p deleting characters and also there are some more options that make using mucomplete easier. I am so used to using the default maps that I do not want smart enter, or<tab>
completion. I just want a list of what I can complete with<c-x><c-o>
and the like.The one issue that I notice that I hope you can help me with is that if I have typed something, and I have not selected anything yet but the pop-up completion menu is visible (pumvisibl() is true), then I must type
<cr><cr>
in order to insert a newline. Please see my configuration of your plugin below, but I have tested it manually after disabling enable_auto_at_startup with the same completeopt, and it seems to work fine without your plugin.I am wondering how
<cr>
is effectively acting like<c-e>
(reject selection and close pum) if nothing has been selected (so ... it doesn't really reject a selection ... just close pum).Thanks for the awesome plugin. It's very fast, and it works very well.