diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-04-20 22:16:39 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-04-20 22:16:39 +0200 |
commit | 9ce47ec0b65f81358febacbd9b808ac8ef7af85c (patch) | |
tree | 8fa0092fcaf1c7c287f3d0aec2aaa8102fdfde44 /src/vim9execute.c | |
parent | 5c787fb7928c4cc1e7d6eec0be1bbd63d903cc8d (diff) | |
download | vim-git-9ce47ec0b65f81358febacbd9b808ac8ef7af85c.tar.gz |
patch 8.2.2792: Vim9: :disas shows instructions for default args but no textv8.2.2792
Problem: Vim9: :disas shows instructions for default args but no text.
Solution: Show the expression test above the default argument instructions.
(closes #8129)
Diffstat (limited to 'src/vim9execute.c')
-rw-r--r-- | src/vim9execute.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/vim9execute.c b/src/vim9execute.c index f471454f8..c90fb65b6 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -4338,6 +4338,7 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc) int line_idx = 0; int prev_current = 0; int current; + int def_arg_idx = 0; for (current = 0; current < instr_count; ++current) { @@ -4345,6 +4346,7 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc) char *line; if (ufunc != NULL) + { while (line_idx < iptr->isn_lnum && line_idx < ufunc->uf_lines.ga_len) { @@ -4357,6 +4359,23 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc) if (line != NULL) msg(line); } + if (iptr->isn_type == ISN_JUMP_IF_ARG_SET) + { + int first_def_arg = ufunc->uf_args.ga_len + - ufunc->uf_def_args.ga_len; + + if (def_arg_idx > 0) + msg_puts("\n\n"); + msg_start(); + msg_puts(" "); + msg_puts(((char **)(ufunc->uf_args.ga_data))[ + first_def_arg + def_arg_idx]); + msg_puts(" = "); + msg_puts(((char **)(ufunc->uf_def_args.ga_data))[def_arg_idx++]); + msg_clr_eos(); + msg_end(); + } + } switch (iptr->isn_type) { |