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

Add option to not reverse select_next_item on bottom_up list (#1346) #1711

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

GustawXYZ
Copy link

@GustawXYZ GustawXYZ commented Sep 26, 2023

* add feature requested in (#1346)

Add a parameter to the function preserve_mapping_verticality, which will keep mappings like and not reversed even when used custom view is used with selection_order = 'top_down' configuration. (Up is up and Down is down even when the list is upside down)

Example use configuration:

    ["<Down>"] = cmp.mapping(cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Select, preserve_mapping_verticality = true }, { "i", "s" }),
    ["<Up>"] = cmp.mapping(cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Select, preserve_mapping_verticality = true }, { "i", "s" }),

…h#1346)

    * add feature requested in (hrsh7th#1346)

Add a parameter to the function preserve_mapping_verticality, which will keep mappings like <Up> and <Down> not reversed even when used custom view is used with `selection_order = 'top_down'` configuration.

Example use configuration:
```
    ["<Down>"] = cmp.mapping(cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Select, preserve_mapping_verticality = true }, { "i", "s" }),
    ["<Up>"] = cmp.mapping(cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Select, preserve_mapping_verticality = true }, { "i", "s" }),
```
@edshamis
Copy link

edshamis commented Feb 5, 2024

Please add this

@GustawXYZ
Copy link
Author

GustawXYZ commented Feb 5, 2024

@edshamis 1! In the meantime feel free to use the fork, in lazy.nvim you can configure this like so:

{
"hrsh7th/nvim-cmp",
url = "https://github.com/GustawXYZ/nvim-cmp",
event = "VeryLazy", 
}

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.

2 participants