Skip to content

Commit ba47b51

Browse files
committed
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Problem: When setting wildoptions=tagfile the completion context is not set correctly. (desjardins) Solution: Check for EXPAND_TAGS_LISTFILES. (Christian Brabandt, closes #1399)
1 parent 6a717f1 commit ba47b51

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

src/ex_getln.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4366,7 +4366,9 @@ addstar(
43664366
|| context == EXPAND_OWNSYNTAX
43674367
|| context == EXPAND_FILETYPE
43684368
|| context == EXPAND_PACKADD
4369-
|| (context == EXPAND_TAGS && fname[0] == '/'))
4369+
|| ((context == EXPAND_TAGS_LISTFILES
4370+
|| context == EXPAND_TAGS)
4371+
&& fname[0] == '/'))
43704372
retval = vim_strnsave(fname, len);
43714373
else
43724374
{

src/testdir/test_cmdline.vim

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,14 @@ func Test_illegal_address()
295295
2;')
296296
quit
297297
endfunc
298+
299+
func Test_cmdline_complete_wildoptions()
300+
help
301+
call feedkeys(":tag /\<c-a>\<c-b>\"\<cr>", 'tx')
302+
let a = join(sort(split(@:)),' ')
303+
set wildoptions=tagfile
304+
call feedkeys(":tag /\<c-a>\<c-b>\"\<cr>", 'tx')
305+
let b = join(sort(split(@:)),' ')
306+
call assert_equal(a, b)
307+
bw!
308+
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
237,
767769
/**/
768770
236,
769771
/**/

0 commit comments

Comments
 (0)