diff options
author | James McCoy <jamessan@jamessan.com> | 2017-04-07 16:08:58 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2017-04-07 16:18:04 -0400 |
commit | 20dc04470e00a369d2ba917a22b06ef2d173953f (patch) | |
tree | bbafc8b525f5c2d88fe0c30053c8a14178cbaab4 /src/nvim/eval.c | |
parent | 13352c00f1909d9296c5f276a3735f5e6f231b39 (diff) | |
download | rneovim-20dc04470e00a369d2ba917a22b06ef2d173953f.tar.gz rneovim-20dc04470e00a369d2ba917a22b06ef2d173953f.tar.bz2 rneovim-20dc04470e00a369d2ba917a22b06ef2d173953f.zip |
vim-patch:8.0.0499
Problem: taglist() does not prioritize tags for a buffer.
Solution: Add an optional buffer argument. (Duncan McDougall, closes vim/vim#1194)
https://github.com/vim/vim/commit/c6aafbaf3ea755e3ab4ee2e3045911126a08b038
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 1636b490d5..e15d6c0240 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -8728,8 +8728,7 @@ static void f_foldtextresult(typval_T *argvars, typval_T *rettv, FunPtr fptr) } fold_count = foldedCount(curwin, lnum, &foldinfo); if (fold_count > 0) { - text = get_foldtext(curwin, lnum, lnum + fold_count - 1, - &foldinfo, buf); + text = get_foldtext(curwin, lnum, lnum + fold_count - 1, &foldinfo, buf); if (text == buf) text = vim_strsave(text); rettv->vval.v_string = text; @@ -16436,7 +16435,12 @@ static void f_taglist(typval_T *argvars, typval_T *rettv, FunPtr fptr) return; } - (void)get_tags(tv_list_alloc_ret(rettv), (char_u *)tag_pattern); + const char *fname = NULL; + if (argvars[1].v_type != VAR_UNKNOWN) { + fname = tv_get_string(&argvars[1]); + } + (void)get_tags(tv_list_alloc_ret(rettv), (char_u *)tag_pattern, + (char_u *)fname); } /* |