comparison src/cmdexpand.c @ 25682:17ba70005a2e v8.2.3377

patch 8.2.3377: Vim9: :disass completion does not understand "s:" Commit: https://github.com/vim/vim/commit/47016f57724d3970c54f4ca1f392dff39d3fecae Author: Bram Moolenaar <Bram@vim.org> Date: Thu Aug 26 16:39:58 2021 +0200 patch 8.2.3377: Vim9: :disass completion does not understand "s:" Problem: Vim9: :disass completion does not understand "s:". Solution: Expand "s:" to a pattern. (closes https://github.com/vim/vim/issues/8780)
author Bram Moolenaar <Bram@vim.org>
date Thu, 26 Aug 2021 16:45:04 +0200
parents 4d3c68196d05
children ba9d587f0b29
comparison
equal deleted inserted replaced
25681:17194bce690e 25682:17ba70005a2e
2071 if (xp->xp_context == EXPAND_PACKADD) 2071 if (xp->xp_context == EXPAND_PACKADD)
2072 return ExpandPackAddDir(pat, num_file, file); 2072 return ExpandPackAddDir(pat, num_file, file);
2073 2073
2074 // When expanding a function name starting with s:, match the <SNR>nr_ 2074 // When expanding a function name starting with s:, match the <SNR>nr_
2075 // prefix. 2075 // prefix.
2076 if (xp->xp_context == EXPAND_USER_FUNC && STRNCMP(pat, "^s:", 3) == 0) 2076 if ((xp->xp_context == EXPAND_USER_FUNC
2077 || xp->xp_context == EXPAND_DISASSEMBLE)
2078 && STRNCMP(pat, "^s:", 3) == 0)
2077 { 2079 {
2078 int len = (int)STRLEN(pat) + 20; 2080 int len = (int)STRLEN(pat) + 20;
2079 2081
2080 tofree = alloc(len); 2082 tofree = alloc(len);
2081 vim_snprintf((char *)tofree, len, "^<SNR>\\d\\+_%s", pat + 3); 2083 vim_snprintf((char *)tofree, len, "^<SNR>\\d\\+_%s", pat + 3);