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

Use floating window for completion menus #224

Merged
merged 109 commits into from
Oct 8, 2021
Merged

Use floating window for completion menus #224

merged 109 commits into from
Oct 8, 2021

Conversation

hrsh7th
Copy link
Owner

@hrsh7th hrsh7th commented Sep 19, 2021

I don't think it can be completed... (and it will introduce a lot of breaking change.)

TODO

  • Refactor
  • Preselect
  • Deprecated
  • Breaking change warnings
  • Avoid other pum
  • C-e
  • Investigate C-c
  • Default highlight
  • Cache with highlight do it later...
  • undo management
  • Border support do it later...

@hrsh7th

This comment has been minimized.

@hrsh7th

This comment has been minimized.

@hrsh7th

This comment has been minimized.

@hrsh7th

This comment has been minimized.

@hrsh7th hrsh7th changed the title WIP: Use floating window for completion menus RFC: Use floating window for completion menus Sep 21, 2021
@hrsh7th

This comment has been minimized.

@uga-rosa

This comment has been minimized.

@hrsh7th

This comment has been minimized.

@uga-rosa

This comment has been minimized.

@uga-rosa

This comment has been minimized.

@hrsh7th

This comment has been minimized.

@Shougo
Copy link

Shougo commented Sep 22, 2021

@hrsh7th Hi. I want to test the feature. What is the fancy menu config?

@E-ricus

This comment has been minimized.

@tzachar

This comment has been minimized.

@hrsh7th

This comment has been minimized.

@tzachar

This comment has been minimized.

@rhcher
Copy link

rhcher commented Sep 25, 2021

Hi, I've been using this branch for a while now. So far it is working well. The only insignificant glitch is in the documentation for entries.
This is in the master branch:
image
And this is in the custom-menu branch:
image

Another minor and insignificant issue is that the match highlighting does not reset after deleting characters
image
then delete some characters
image
If you are already aware of these minor issues, please ignore it.

@uga-rosa

This comment has been minimized.

@akinsho

This comment has been minimized.

@uga-rosa

This comment has been minimized.

@tzachar

This comment has been minimized.

@hrsh7th hrsh7th merged commit ada9dde into main Oct 8, 2021
@hrsh7th hrsh7th deleted the custom-menu branch October 8, 2021 09:27
@gegoune
Copy link
Contributor

gegoune commented Oct 8, 2021

Amazing job @hrsh7th! Thank you so so much!

@astier
Copy link

astier commented Oct 8, 2021

Just curious. Why implement a new custom floating menu when the native completion menu exists? I don't really notice any difference.

@lewis6991
Copy link
Contributor

lewis6991 commented Oct 8, 2021

Just curious. Why implement a new custom floating menu when the native completion menu exists? I don't really notice any difference.

A custom menu allows highlighting and much more fine grained control in general.

See screenshots above

wimstefan added a commit to wimstefan/dotfiles that referenced this pull request Oct 8, 2021
* remove cmp-treesitter
* make TAB completion work with new floating menu introduced in hrsh7th/nvim-cmp#224
@mortezadadgar
Copy link

I feel it's faster now!

@yujinyuz
Copy link

yujinyuz commented Oct 8, 2021

Thanks @hrsh7th I can feel drastic improvements compared to the old one

mjlbach pushed a commit to mjlbach/starter.nvim that referenced this pull request Oct 8, 2021
Changed in hrsh7th/nvim-cmp#224.

This just replaces the `if` condition and `nvim_replace_termcodes`.
fitrh added a commit to fitrh/init.nvim that referenced this pull request Oct 9, 2021
@kkharji
Copy link

kkharji commented Oct 9, 2021

😍 @hrsh7th this is crazy!!! well done you just reach something I don't think anyone can match. Congratulations

mfkd added a commit to mfkd/dotfiles that referenced this pull request Oct 10, 2021
This just replaces the `if` condition and `nvim_replace_termcodes`.
Changed in hrsh7th/nvim-cmp#224.
lasse16 added a commit to lasse16/dotfiles that referenced this pull request Oct 11, 2021
With PR hrsh7th/nvim-cmp#224, nvim-cmp uses
floating windows instead of the vim-internal pummenu. The previous
function to resolve the <Tab> key relied on the `pumvisible` function to
check for an open completion window, which is not possible anymore.
The new function features an extra branch checking for an open
completion window, via `cmp.visible()`..
@oblitum
Copy link

oblitum commented Nov 27, 2021

Tried cmp briefly and it seems the suggestion for preselect = 'always' has no effect after this PR.

kontza pushed a commit to kontza/defaults.nvim that referenced this pull request May 5, 2022
Changed in hrsh7th/nvim-cmp#224.

This just replaces the `if` condition and `nvim_replace_termcodes`.
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

Successfully merging this pull request may close these issues.