comparison src/cmdexpand.c @ 31819:aec031683d61 v9.0.1242

patch 9.0.1242: code for :runtime completion is not consistent Commit: https://github.com/vim/vim/commit/b0d45ec67f4976318f199a7929ad3bcf93686fd0 Author: zeertzjq <zeertzjq@outlook.com> Date: Wed Jan 25 15:04:22 2023 +0000 patch 9.0.1242: code for :runtime completion is not consistent Problem: Code for :runtime completion is not consistent. Solution: Make code for cmdline expansion more consistent. (closes https://github.com/vim/vim/issues/11875)
author Bram Moolenaar <Bram@vim.org>
date Wed, 25 Jan 2023 16:15:06 +0100
parents c5ff7d053fa1
children bea4ebf594c6
comparison
equal deleted inserted replaced
31818:9a2b2949d045 31819:aec031683d61
1361 1361
1362 // For help tags the translation is done in find_help_tags(). 1362 // For help tags the translation is done in find_help_tags().
1363 // For a tag pattern starting with "/" no translation is needed. 1363 // For a tag pattern starting with "/" no translation is needed.
1364 if (context == EXPAND_HELP 1364 if (context == EXPAND_HELP
1365 || context == EXPAND_COLORS 1365 || context == EXPAND_COLORS
1366 || context == EXPAND_RUNTIME
1367 || context == EXPAND_COMPILER 1366 || context == EXPAND_COMPILER
1368 || context == EXPAND_OWNSYNTAX 1367 || context == EXPAND_OWNSYNTAX
1369 || context == EXPAND_FILETYPE 1368 || context == EXPAND_FILETYPE
1370 || context == EXPAND_PACKADD 1369 || context == EXPAND_PACKADD
1370 || context == EXPAND_RUNTIME
1371 || ((context == EXPAND_TAGS_LISTFILES 1371 || ((context == EXPAND_TAGS_LISTFILES
1372 || context == EXPAND_TAGS) 1372 || context == EXPAND_TAGS)
1373 && fname[0] == '/')) 1373 && fname[0] == '/'))
1374 retval = vim_strnsave(fname, len); 1374 retval = vim_strnsave(fname, len);
1375 else 1375 else
2312 case CMD_colorscheme: 2312 case CMD_colorscheme:
2313 xp->xp_context = EXPAND_COLORS; 2313 xp->xp_context = EXPAND_COLORS;
2314 xp->xp_pattern = arg; 2314 xp->xp_pattern = arg;
2315 break; 2315 break;
2316 2316
2317 case CMD_runtime:
2318 set_context_in_runtime_cmd(xp, arg);
2319 break;
2320
2321 case CMD_compiler: 2317 case CMD_compiler:
2322 xp->xp_context = EXPAND_COMPILER; 2318 xp->xp_context = EXPAND_COMPILER;
2323 xp->xp_pattern = arg; 2319 xp->xp_pattern = arg;
2324 break; 2320 break;
2325 2321
2334 break; 2330 break;
2335 2331
2336 case CMD_packadd: 2332 case CMD_packadd:
2337 xp->xp_context = EXPAND_PACKADD; 2333 xp->xp_context = EXPAND_PACKADD;
2338 xp->xp_pattern = arg; 2334 xp->xp_pattern = arg;
2335 break;
2336
2337 case CMD_runtime:
2338 set_context_in_runtime_cmd(xp, arg);
2339 break; 2339 break;
2340 2340
2341 #if defined(HAVE_LOCALE_H) || defined(X_LOCALE) 2341 #if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
2342 case CMD_language: 2342 case CMD_language:
2343 return set_context_in_lang_cmd(xp, arg); 2343 return set_context_in_lang_cmd(xp, arg);