-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Use the correct case in completion pager #7744
Use the correct case in completion pager #7744
Conversation
807cb57
to
1b014a8
Compare
1b014a8
to
5220d3b
Compare
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.
This seems to work, but I've never been comfortable with this bit of the completions, so I wouldn't want to merge this for 3.2.1.
Unless you're really really sure that this time it's correct.
I'm sure it works, I just wasn't sure if it's okay to remove this feature. (Given |
5220d3b
to
8e1b937
Compare
Probably fine to merge now. Neat test! |
Consider $ complete -c foo -a 'aab aaB' -f $ foo A<TAB> since 28d67c8 we would insert the common prefix AND show the pager. Due to case-insensitive comparison, "b/B" was considered to be part of the prefix. Since the prefix is added to each pager item [1] we get wrong results. Fix this by removing the insensitive comparison between completions - I don't think it was of much use anyway. Commandline tokens are still matched case-insensitively, this is just about completions. Test this by running interactive fish inside tmux (pexpect's terminal emulation not have enough capabilities). Also add tests for recent interactive regressions fish-shell#7526 and fish-shell#7738. Closes fish-shell#3978 [1]: b38a23a would solve this differently by giving every pager item its own prefix, but was reverted since it needs more fixes.
8e1b937
to
a4d0fdd
Compare
Added changelog. The |
OK, I'm trying to get my head around this for the release notes. I can't reproduce the "wrong" behaviour in 3.2.1, which I think is because we backed out the case-insensitive completion stuff before the 3.2.0 release? And it doesn't look like we've added it back in? |
We didn't back out smartcase completion. This bug was that the pager entries were incorrect after the pager's common-prefix-insertion. Reproduce with |
Thanks. I think I'm confused about what smartcase completions actually are; with a directory containing a single file |
Fish uses "tiered" completions,
So if some completion on 2 matches the token, then the case-insensitive-only matches (3) are not displayed, if that makes sense. AIUI, smartcase is about showing both 2 and 3, if the string on the command line is all-lowercase. |
This resolves the regression mentioned in #7738 (comment) and the comments below.
The previous version revived b38a23a, but I didn't manage to fix all problems.
This version uses a simpler fix.
Add a tmux-based tests, including tests for recent interactive regressions #7526 and #7738.
(I coudn't get this pexpect test to work)
TODOs: