comparison src/option.c @ 28786:fd5942a62312 v8.2.4917

patch 8.2.4917: fuzzy expansion of option names is not right Commit: https://github.com/vim/vim/commit/cb747899bd99361a299a163f3aa55d5fe7d6f798 Author: Christian Brabandt <cb@256bit.org> Date: Sun May 8 21:10:56 2022 +0100 patch 8.2.4917: fuzzy expansion of option names is not right Problem: Fuzzy expansion of option names is not right. Solution: Pass the fuzzy flag down the call chain. (Christian Brabandt, closes #10380, closes #10318)
author Bram Moolenaar <Bram@vim.org>
date Sun, 08 May 2022 22:15:02 +0200
parents d770568e6c98
children fea88e555652
comparison
equal deleted inserted replaced
28785:cf6469422b92 28786:fd5942a62312
6509 ExpandSettings( 6509 ExpandSettings(
6510 expand_T *xp, 6510 expand_T *xp,
6511 regmatch_T *regmatch, 6511 regmatch_T *regmatch,
6512 char_u *fuzzystr, 6512 char_u *fuzzystr,
6513 int *numMatches, 6513 int *numMatches,
6514 char_u ***matches) 6514 char_u ***matches,
6515 int can_fuzzy)
6515 { 6516 {
6516 int num_normal = 0; // Nr of matching non-term-code settings 6517 int num_normal = 0; // Nr of matching non-term-code settings
6517 int num_term = 0; // Nr of matching terminal code settings 6518 int num_term = 0; // Nr of matching terminal code settings
6518 int opt_idx; 6519 int opt_idx;
6519 int match; 6520 int match;
6525 static char *(names[]) = {"all", "termcap"}; 6526 static char *(names[]) = {"all", "termcap"};
6526 int ic = regmatch->rm_ic; // remember the ignore-case flag 6527 int ic = regmatch->rm_ic; // remember the ignore-case flag
6527 int fuzzy; 6528 int fuzzy;
6528 fuzmatch_str_T *fuzmatch = NULL; 6529 fuzmatch_str_T *fuzmatch = NULL;
6529 6530
6530 fuzzy = cmdline_fuzzy_complete(fuzzystr); 6531 fuzzy = can_fuzzy && cmdline_fuzzy_complete(fuzzystr);
6531 6532
6532 // do this loop twice: 6533 // do this loop twice:
6533 // loop == 0: count the number of matching options 6534 // loop == 0: count the number of matching options
6534 // loop == 1: copy the matching options into allocated memory 6535 // loop == 1: copy the matching options into allocated memory
6535 for (loop = 0; loop <= 1; ++loop) 6536 for (loop = 0; loop <= 1; ++loop)