diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-03-21 10:27:59 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-03-21 10:35:26 -0400 |
commit | c620ca4cc2f5c0b3cebde2e172ed1682b06f4495 (patch) | |
tree | 34a631b515f553447aa21f0400c8a576bb20dc61 /src | |
parent | 749a8b6be767ee3e4dfd83af72973b386ac5ead1 (diff) | |
download | rneovim-c620ca4cc2f5c0b3cebde2e172ed1682b06f4495.tar.gz rneovim-c620ca4cc2f5c0b3cebde2e172ed1682b06f4495.tar.bz2 rneovim-c620ca4cc2f5c0b3cebde2e172ed1682b06f4495.zip |
vim-patch:8.2.2634: 'tagfunc' does not indicate using a pattern
Problem: 'tagfunc' does not indicate using a pattern.
Solution: Add the "r" flag. (Andy Massimino, closes vim/vim#7982)
https://github.com/vim/vim/commit/f90c855c71863296859780f7b4e0386e96f1c465
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/tag.c | 7 | ||||
-rw-r--r-- | src/nvim/testdir/test_tagfunc.vim | 14 |
2 files changed, 17 insertions, 4 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c index 4ea298fba9..8d9ae68985 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -1141,7 +1141,7 @@ static int find_tagfunc_tags( int result = FAIL; typval_T args[4]; typval_T rettv; - char_u flagString[3]; + char_u flagString[4]; dict_T *d; taggy_T *tag = &curwin->w_tagstack[curwin->w_tagstackidx]; @@ -1170,9 +1170,10 @@ static int find_tagfunc_tags( args[3].v_type = VAR_UNKNOWN; vim_snprintf((char *)flagString, sizeof(flagString), - "%s%s", + "%s%s%s", g_tag_at_cursor ? "c": "", - flags & TAG_INS_COMP ? "i": ""); + flags & TAG_INS_COMP ? "i": "", + flags & TAG_REGEXP ? "r": ""); save_pos = curwin->w_cursor; result = call_vim_function(curbuf->b_p_tfu, 3, args, &rettv); diff --git a/src/nvim/testdir/test_tagfunc.vim b/src/nvim/testdir/test_tagfunc.vim index 242aa3a235..bb465bafb7 100644 --- a/src/nvim/testdir/test_tagfunc.vim +++ b/src/nvim/testdir/test_tagfunc.vim @@ -43,12 +43,24 @@ func Test_tagfunc() call assert_equal('one', g:tagfunc_args[0]) call assert_equal('c', g:tagfunc_args[1]) + let g:tagfunc_args=[] + execute "tag /foo$" + call assert_equal('foo$', g:tagfunc_args[0]) + call assert_equal('r', g:tagfunc_args[1]) + set cpt=t let g:tagfunc_args=[] execute "normal! i\<c-n>\<c-y>" - call assert_equal('ci', g:tagfunc_args[1]) + call assert_equal('\<\k\k', g:tagfunc_args[0]) + call assert_equal('cir', g:tagfunc_args[1]) call assert_equal('nothing1', getline('.')[0:7]) + let g:tagfunc_args=[] + execute "normal! ono\<c-n>\<c-n>\<c-y>" + call assert_equal('\<no', g:tagfunc_args[0]) + call assert_equal('cir', g:tagfunc_args[1]) + call assert_equal('nothing2', getline('.')[0:7]) + func BadTagFunc1(...) return 0 endfunc |