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

breaks completion if completeopt=noinsert #85

Closed
astier opened this issue Jul 29, 2020 · 3 comments
Closed

breaks completion if completeopt=noinsert #85

astier opened this issue Jul 29, 2020 · 3 comments

Comments

@astier
Copy link

astier commented Jul 29, 2020

Minimal vimrc

cal plug#begin($XDG_DATA_HOME.'/nvim/plugins')
Plug 'dkarter/bullets.vim'
cal plug#end()
set completeopt=menu,noinsert

Steps to reproduce

  1. Start nvim
  2. Start insertmode and type /
  3. <c-x><c-f> should show a menu with suggested completions like /bin and /etc
  4. Press <cr> to accept first suggestion

Actual behavior

A new line is created instead accepting the first suggestion. This only happens when bullets is loaded.

Expected behavior

The first suggestion should be selected instead of creating a new line. This would also be vims default behavior with set completeopt=menu,noinsert.

Notes

This is probably the reason for issue #74. You said there that you select the completion manually with <c-p> and<c-n>. Many people just accept the first suggestion with .

@astier
Copy link
Author

astier commented Jul 29, 2020

I would suggest that bullets should not modify <cr> if pumvisible is true.

@dkarter
Copy link
Member

dkarter commented Jul 29, 2020

Thanks @astier, I'm happy to take PRs!

@eight04
Copy link

eight04 commented Nov 10, 2023

For anyone using coc:
https://github.com/neoclide/coc.nvim/wiki/Completion-with-sources#use-cr-to-confirm-completion

You have to replace <cr> with <Plug>(bullets-newline) e.g.

let g:bullets_set_mappings = 0
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm() : "<Plug>(bullets-newline)"

@astier astier closed this as completed Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants