-
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
feat: add option for view to follow cursor #1727
Conversation
CI seems failed. |
If I'm reading the commit history correctly, that test has been failing since August 10th, so over two months. That gives me the impression that the error doesn't come from these two commits. If you believe it does and not from earlier commits, I'd like some help identifying where they come from. |
Oh.... So CI fix commit is needed. |
Just to be clear, you'd like a CI fix in this PR? I'd argue that that's outside of the scope of this particular PR, but I'm open to trying to fix it. |
I think it should be another PR. |
Okay, I can try. I am new to this code base, but I'd be open to trying to fix it and contributing to other things too. I am busy until Thursday morning. After that, I can take a look at that CI problem. Edit: I'm working on this in #1729 |
can you rebase the PR? |
Creates an option to allow the custom entries view to follow the user's cursor as they type. To enable, set ```lua require("cmp").setup({ view = { entries = { follow_cursor = true } } }) ``` Original source at lvimuser@7569056 Closes #1660 Co-authored-by: lvimuser <[email protected]>
@Shougo done. Thank you for orchestrating this Edit: if this is set to be merged, I will produce documentation for it. |
@hrsh7th I've seen comments saying that you are feeling cautious about integrating new features because it will increase your maintenance burden, and you are busy. I would be happy to take ownership of this feature and its resulting issues if this PR were merged, similar to how Neovim itself has owners for new features. |
The screenshot may help to understand the feature works. |
No problem at all, I'd be happy to provide some GIFs. To recap, the purpose of this PR is to allow the pmenu to follow the cursor as the user types. This feature is opt-in, and the current behavior remains the default. Current BehaviorNormally, the pmenu does not follow the user: Additional BehaviorI have been using this since I made this PR, and I personally like it a lot. Some users may like this feature because it is like VSCode's autocomplete. Again, it is opt-in, so no one has to use it if they don't want to but it gives people another option. |
IMO, it should be The native menu is a bit complicated, so I would like to exclude it from the list and annotate docs. |
@hrsh7th I have updated the PR so that the native menu is excluded and the docs do not mention it. Please let me know if there are any other changes you would like me to make. |
LGTM. Thank you. |
@@ -679,6 +679,13 @@ view.docs.auto_open~ | |||
|
|||
Specify whether to show the docs_view when selecting an item. | |||
|
|||
*cmp-config.view.follow_cursor* | |||
view.follow_cursor* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, reading the rest of the final change it seems the help tags here are wrong, they should use view.entries.follow_cursor
since the option is under entries
🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot, thanks! I'll submit a fix today
I've addressed my docs error as well as some other issues in the |
What does this mean? Say I want to try the new option by this PR, then what should I do to ensure that it's only used with OK, I found the answer. I should keep the nvim-cmp/lua/cmp/config/default.lua Lines 96 to 105 in ce16de5
|
This option will not do anything when used with That comment was left for me and was instructing me to make it so that the native view cannot use this option. |
Creates an option to allow the custom entries
view to follow the user's cursor as they type.
To enable, set
Original custom view source at lvimuser@7569056
Closes #1660