Don't insert prefix for non-prefix matches #3090

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@faho
Member
faho commented May 30, 2016

The issue here is that when inserting a common prefix for e.g. a
substring match, we increase the amount of available candidates again to
things the user didn't want.

An example is in share/functions - a completion for "inter" would
previously expand to "_fish" because it matched:

  • __fish_config_interactive.fish
  • __fish_print_interfaces.fish
  • __fish_print_lpr_printers.fish

The completion afterwards would then show 189 possible matches, only
three of which (the above) actually matched the original "inter".

Fixes #3089.

I'm trying to come to terms with both C++ and our codebase, so any criticism is much appreciated!

@faho faho Don't insert prefix for non-prefix matches
The issue here is that when inserting a common prefix for e.g. a
substring match, we increase the amount of available candidates again to
things the user didn't want.

An example is in share/functions - a completion for "inter" would
previously expand to "__fish_" because it matched:

- __fish_config_interactive.fish
- __fish_print_interfaces.fish
- __fish_print_lpr_printers.fish

The completion afterwards would then show 189 possible matches, only
three of which (the above) actually matched the original "inter".

Fixes #3089.
359919b
@faho faho added this to the next-2.x milestone May 30, 2016
@zanchey
Member
zanchey commented Jun 2, 2016

I think this would go some way to fixing the surprising behaviour in 701a37f.

@faho faho referenced this pull request Jun 2, 2016
Closed

Roll a 2.3.1 release #3106

@krader1961
Member

LGTM. I tested it and it fixes the reported behavior and doesn't seem to break anything. I fixed the formatting of a couple of comments and merged as commit 57f2898.

@krader1961 krader1961 closed this Jun 3, 2016
@krader1961 krader1961 modified the milestone: fish 2.3.1, next-2.x Sep 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment