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

ivy-completion-in-region: correctly calculate the length of replacement for file category #3051

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kiennq
Copy link
Contributor

@kiennq kiennq commented Jul 6, 2024

  • Ensure accurate calculation of the common length for completion items. The string face may contain only a single completions-first-difference, rather than a list of them.
  • Additionally, when dealing with file category completions, calculate the prefix offset from the file name directory, not the entire input string. This adjustment is necessary because fuzzy completion styles can lead to incorrect common length values. The prefix offset ensures that we replace only the relevant portion of the input when calculating completion items.

@kiennq kiennq force-pushed the fix/completion-prefix-len branch from 7b6a90e to 4f906b7 Compare July 6, 2024 05:37
@basil-conto
Copy link
Collaborator

Thanks! I'll try to have a closer look at this soon.

In the meantime, I'm curious: does this relate at all to the issues described in #1755?

@kiennq
Copy link
Contributor Author

kiennq commented Aug 13, 2024

Thanks! I'll try to have a closer look at this soon.

In the meantime, I'm curious: does this relate at all to the issues described in #1755?

Yes, it should address that issue. The first item is actually used to fix that.

Ensure accurate calculation of the common length for completion items. The string face may contain only a single completions-first-difference, rather than a list of them.

@TristanCacqueray
Copy link

Hello, this fixes #1755 and #3056 for me too after updating to the emacs-30 branch. Thanks!

TristanCacqueray added a commit to podenv/devenv that referenced this pull request Sep 12, 2024
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.

File name completion overwrites already entered path in shell-mode
3 participants