fix: avoid overwrting user defined mapping#154
Conversation
fix some stuff fix not show error on old mapping
432963d to
e5f3a3b
Compare
|
Hmmm, it would probably be good to add an API around seeing if there exists any keymap for a particular key.... we do not have it yet though 😆 I wouldn't be worried about the performance, luajit would probably be fast enough. You could always just disable it on default? I'm not sure. The surprising thing was that Perhaps just making it not a default anything would be better? (Sorry, I don't have a great solution nor understand 100% what's happening) |
|
You could try to chain the functionality onto the confirmation key. That makes for a more seamless user experience (and it's what tpope does) |
|
Doh. I checked issues, but did not see this pull request. I have suffered from this today, #255, with a similar fix: taylan97#1 Seems it's kind of old and no conflict, any reason to not merge? I do kind of wonder if it's required for completion to set the binding and not just delegate that to the user configuration? I get that it has a custom function you have to call, I don't think it can just hook into whatever normal vim "confirm completion" stuff. If you do have to set it in the actual plugin, I think a less intrusive option would be vim's default completion accept combo, over CR, people who want CR can use the confirm_key option. |
I get called out on stream...so I must fix this 😢
Right now completion-nvim will prompt you to change your g:completion_confirm_key if you already have some mapping on
<CR>and won't overwrite it.Some notes here: There is no api to get a specific mapping. I used
nvim_buf_get_keymapandnvim_get_keymapto get a full list of mapping then iterate then to check if there's conflicting mapping, which I think is not that smart... I wonder if there's a better way to do it.cc @kdheepak @tjdevries
fixes #153