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

Cursor position moved to wrong position with completion.keyword.range = "full" #968

Closed
2 tasks done
OmegaLambda1998 opened this issue Jan 9, 2025 · 4 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@OmegaLambda1998
Copy link

OmegaLambda1998 commented Jan 9, 2025

Make sure you have done the following

  • Updated to the latest version of blink.cmp
  • Searched for existing issues and documentation (try <C-k> on https://cmp.saghen.dev)

Bug Description

import click

@click.command()
def project() -> None:
    click.echo("Creating new |Project")

With completion.keyword.range = "full", if my cursor is at | (which isn't a character in the actual text) and I press any letter or number in insert mode (in this case n), then my cursor will move to the top line like so:

import click|

@click.command()
def project() -> None:
    click.echo("Creating new nProject")

However this behaviour is not present with completion.keyword.range = "prefix" (or if I disable loading blink.cmp at all). This is in a file called test.xyz with no LSPs loaded so I don't think this is a python specific issue. I observe similar behaviour in lua files (ironically when trying to write prefix in the string "full").

Relevant configuration

No response

neovim version

NVIM v0.11.0-dev-1503+gc4b658fed8 Build type: Release LuaJIT 2.1.1731601260 Run "nvim -V1 -v" for more info

blink.cmp version

80945db

@OmegaLambda1998 OmegaLambda1998 added the bug Something isn't working label Jan 9, 2025
@OmegaLambda1998
Copy link
Author

OmegaLambda1998 commented Jan 9, 2025

I've done some more investigating and have some more info.

opts.completion.keyword = {
    range = "|prefix",
}

With my cursor at |, and both blink.cmp and lazydev loaded (lazydev config shown below), then pressing c in normal mode (to initiate the 'change within' motion) will also shift the cursor wildly. Disabling either lazydev or blink.cmp results in the expected behaviour and cursor staying consistent. This behaviour is the same for both the prefix and full ranges.

Maybe it's a weird interaction with creating the completion menu buffers?

@rollsrobby
Copy link

rollsrobby commented Jan 9, 2025

I noticed the same with completion.documentation.auto_show = true. If I set it to false the issue is gone.
You can see that the jump happens after the completion.documentation.auto_show_delay_ms.

Nevermind. It's not gone with setting it to false.

@rollsrobby
Copy link

I think it's related to nvim nightly. It seems to work fine if I switch back to nvim v.10.3

@OmegaLambda1998
Copy link
Author

Probably is something temporary in nightly. Updating to the latest commit (from a few minutes ago) seems to have resolved the issue...

NVIM v0.11.0-dev-1509+g3f0adf90de
Build type: Release
LuaJIT 2.1.1731601260
Run "nvim -V1 -v" for more info

@Saghen Saghen closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants