-
Notifications
You must be signed in to change notification settings - Fork 411
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
Allow to position the float window above the current line #495
Comments
I think it's useful but hard to define the configuration design. proposal cmp.setup {
appearance = {
menu = {
direction = 'above' -- auto or above or below
}
}
} |
I came here looking for just this, started using Github Copilot and found this annoying. This'd be a great feature to see! |
I want to define the direction to be "above" by default too, I like the proposal entry idea by @hrsh7th : appearance = {
menu = {
direction = 'above' -- auto or above or below
}
} I would also suggest instead of these 3 options, to be able to define which is the default direction (this means, "auto" would have a preference to go below but we may have the preference to go above, this is in fact the ideal by using with Copilot) So just like @lukamanitta I have the menu to be very annoying when using with Copilot because it overlaps all the time what you see in Copilot, and I don't want to disable CMP in order to use it 🤔 I don't know much the code but looks like the "decision" to go in one direction or the other is around this line: https://github.com/hrsh7th/nvim-cmp/blob/main/lua/cmp/view/custom_entries_view.lua#L178 |
I'm also interested in this feature because of Copilot. I'm using cmp for lsp completions, but virtual text do display copilot suggestions. As-is, cmp can cover copilot suggestions. Is this something you'd consider accepting a pull request for? |
This is not done yet, am I right? |
Works best with vim.opt.scrolloff = 999 Fixes: hrsh7th#495
Works best with vim.opt.scrolloff = 999 Fixes: hrsh7th#495 Suggested-by: Thanatermesis <thanatermesis@gmail.com>
'above' works best with vim.opt.scrolloff = 999. Fixes: hrsh7th#495 Helped-by: Thanatermesis <thanatermesis@gmail.com>
I made a PR if y'all are interested @pwntester @hrsh7th @lukamanitta @Thanatermesis @DanielPower @MannyFay |
'above' works best with vim.opt.scrolloff = 999. Fixes: hrsh7th#495 Helped-by: Thanatermesis <thanatermesis@gmail.com>
Thank you, it works! :) @hrsh7th include it in nvim-cmp? |
The author seems to be cautious about adding the feature. |
'above' works best with vim.opt.scrolloff = 999. Fixes: hrsh7th#495 Helped-by: Thanatermesis <thanatermesis@gmail.com>
'above' works best with vim.opt.scrolloff = 999. Fixes: hrsh7th#495 Helped-by: Thanatermesis <thanatermesis@gmail.com>
'above' works best with vim.opt.scrolloff = 999. Fixes: hrsh7th#495 Helped-by: Thanatermesis <thanatermesis@gmail.com>
'above' works best with vim.opt.scrolloff = 999. Fixes: hrsh7th#495 Helped-by: Thanatermesis <thanatermesis@gmail.com>
It's really a shame that this hasn't been added in 3 YEARS. The default behaviour just makes using copilot a pain. I am considering just building the plugin from the pull request to be able to use it. |
'above' works best with vim.opt.scrolloff = 999. Fixes: hrsh7th#495 Helped-by: Thanatermesis <thanatermesis@gmail.com>
Is the commit going to be merged in order to define the window position? |
It would be nice to have an option that tells cmp where you prefer the float window to be positioned (eg: N, NE, NO, E, O, SE and SO). The main reason for it is that plugins such as copilot.nvim place the suggestions as virtual text so you get them behind the cmp float window.
cmp is already positioning the float window above the current line when the typing at the bottom of a window or when completing on the command line. It would be great to add an option to tell cmp where you prefer the window to be positioned.
Thanks!
The text was updated successfully, but these errors were encountered: