comparison src/vim9execute.c @ 24909:09d222e89a84 v8.2.2992

patch 8.2.2992: Vim9: completion for :disassemble is incomplete Commit: https://github.com/vim/vim/commit/4ee9d8e04daa97a3d0a19d7d2eed76b7721301e6 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 13 18:38:48 2021 +0200 patch 8.2.2992: Vim9: completion for :disassemble is incomplete Problem: Vim9: completion for :disassemble is incomplete. Solution: Recognize the "debug" and "profile" arguments.
author Bram Moolenaar <Bram@vim.org>
date Sun, 13 Jun 2021 18:45:03 +0200
parents 701e4a2576dd
children f11779c1d123
comparison
equal deleted inserted replaced
24908:f2d35a98ae9c 24909:09d222e89a84
5369 break; 5369 break;
5370 } 5370 }
5371 } 5371 }
5372 5372
5373 /* 5373 /*
5374 * Handle command line completion for the :disassemble command.
5375 */
5376 void
5377 set_context_in_disassemble_cmd(expand_T *xp, char_u *arg)
5378 {
5379 char_u *p;
5380
5381 // Default: expand user functions, "debug" and "profile"
5382 xp->xp_context = EXPAND_DISASSEMBLE;
5383 xp->xp_pattern = arg;
5384
5385 // first argument already typed: only user function names
5386 if (*arg != NUL && *(p = skiptowhite(arg)) != NUL)
5387 {
5388 xp->xp_context = EXPAND_USER_FUNC;
5389 xp->xp_pattern = skipwhite(p);
5390 }
5391 }
5392
5393 /*
5394 * Function given to ExpandGeneric() to obtain the list of :disassemble
5395 * arguments.
5396 */
5397 char_u *
5398 get_disassemble_argument(expand_T *xp, int idx)
5399 {
5400 if (idx == 0)
5401 return (char_u *)"debug";
5402 if (idx == 1)
5403 return (char_u *)"profile";
5404 return get_user_func_name(xp, idx - 2);
5405 }
5406
5407 /*
5374 * ":disassemble". 5408 * ":disassemble".
5375 * We don't really need this at runtime, but we do have tests that require it, 5409 * We don't really need this at runtime, but we do have tests that require it,
5376 * so always include this. 5410 * so always include this.
5377 */ 5411 */
5378 void 5412 void