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

[Bug] pressing backspace with the wildmenu reopens it in the wrong position #1

Closed
akinsho opened this issue Sep 30, 2022 · 8 comments
Closed

Comments

@akinsho
Copy link

akinsho commented Sep 30, 2022

Hi @folke,

Just tried this plugin out, and it's fantastic out of the box 🚀. Really cool that it works so well despite all the lingering bugs in the vim.ui_attach api.

Since it's still WIP thought I'd report an issue I noticed using it.

I've noticed that whilst autocompleting with the wildmenu (at least I assume the menu that looks like the cmp window is the wildmenu). When I hit backspace, the window re-opens in the wrong position, just above the original commandline position.

image

I'm currently using cmdheight=0 if that's relevant and can reproduce it using the following steps, note the specific completion is somewhat arbitrary, it's just one I noticed.

  1. type cmenu<space>
  2. press <tab> to open the wildmenu (or whatever key you have setup)
  3. select the first completion item (if you don't use preselect)
  4. Press backspace
  5. See bug
@folke
Copy link
Owner

folke commented Sep 30, 2022

I can reproduce this. Will check it out!

@folke
Copy link
Owner

folke commented Sep 30, 2022

I checked and the popup completions I get bottom left aren't even coming from the cmdline, but are regular cmp cmpletions.

I'll just implement a simple popup view that looks similar, but doesn't do anything.

@folke folke closed this as completed in 0d5be0c Sep 30, 2022
@folke
Copy link
Owner

folke commented Sep 30, 2022

The fix was actually easy. The problem was that the cmdline window did not have buftype=nofile set, so the regular cmp also tried to show completions at the same time 😄

@akinsho
Copy link
Author

akinsho commented Sep 30, 2022

@folke thanks for picking this up so quickly, I can still reproduce the issue on the latest commit unfortunately 🤔

@folke folke reopened this Sep 30, 2022
@folke
Copy link
Owner

folke commented Oct 3, 2022

This should be fixed now in the latest version. Things I changed:

  • I made a proper fix to the existing cmp api functions to get the position, screen position and line of the cmdline when Noice is active. Will see to make a PR to cmp that exposes an API to set the cmdline position from other plugins, but this works for now.
  • I implemented a proper cmp source noice_popupmenu that is automatically added when no other cmdline sources have been configured.

With these changes, things should work as expected:

  • cmp popupmenu should always be positioned correctly
  • pmenu items (the ones I get from ui_attach/ext_popupmenu will be used for completion if no other cmp cmdline sources were configured
  • if you're using cmp-cmdline, then that will work as it did before

Let me know if you encounter any more issues!

@akinsho
Copy link
Author

akinsho commented Oct 3, 2022

@folke that sounds great 👍🏿, I'm not able to test further though as I plan to stay on 0.8 stable rather than nightly and the requirement has understandably been raised to nightly. I've found working on nightly too inconvenient. I'll close these out as is given the changes you've applied 👍🏿

@akinsho akinsho closed this as completed Oct 3, 2022
@folke
Copy link
Owner

folke commented Oct 3, 2022

@akinsho I relaxed the requirements back to 0.8.0 for now.

They might change again, if new fixes/functionality becomes available in 0.9.0, but for now, it should work.

You might still want to not use Noice though, if you want a stable Neovim ;)

@akinsho
Copy link
Author

akinsho commented Oct 3, 2022

@folke just tested it out on 0.8, and it works nicely, both issues are resolved as you say. Totally get you re. changing the requirement up to 0.9 at some point, I understand that maintaining the workarounds might get inconvenient or incompatible with 0.9 changes. Maybe when the time comes to bump it you can leave the 0.8 version in a branch, since presumably/hopefully that should be fine to continue to use as is till 0.9 is released.

Re. Noice's own stability, I'm less worried about a handful of plugins that might not be super stable (as that's easy to disable temporarily) as long as the editor is not playing up around some crucial deadline 🤣

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

2 participants