mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
Address review comments.
This commit is contained in:
parent
e7de891f27
commit
4726231a85
@ -2356,11 +2356,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
NOTE: This option is reset when 'compatible' is set.
|
NOTE: This option is reset when 'compatible' is set.
|
||||||
Also see 'preserveindent'.
|
Also see 'preserveindent'.
|
||||||
|
|
||||||
*'copytagstack'* *'cptgst'* *'nocopytagstack'* *'nocptgst'*
|
|
||||||
'copytagstack' 'cptgst' boolean (default: on)
|
|
||||||
global
|
|
||||||
Copy tag stack when splitting window.
|
|
||||||
|
|
||||||
*'cpoptions'* *'cpo'* *cpo*
|
*'cpoptions'* *'cpo'* *cpo*
|
||||||
'cpoptions' 'cpo' string (Vim default: "aABceFsz",
|
'cpoptions' 'cpo' string (Vim default: "aABceFsz",
|
||||||
Vi default: all flags, except "#{|&/\."
|
Vi default: all flags, except "#{|&/\."
|
||||||
@ -8709,6 +8704,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
Resetting this option is useful when using a ":tag" command in a
|
Resetting this option is useful when using a ":tag" command in a
|
||||||
mapping which should not change the tagstack.
|
mapping which should not change the tagstack.
|
||||||
|
|
||||||
|
*'tagstackcopy'* *'tgstcp'* *'notagstackcopy'* *'notgstcp'*
|
||||||
|
'tagstackcopy' 'tgstcp' boolean (default: on)
|
||||||
|
global
|
||||||
|
If on, the tagstack is copied from original windows when creating a
|
||||||
|
new one (e.g. via :split). When off, new windows start afresh.
|
||||||
|
|
||||||
*'tcldll'*
|
*'tcldll'*
|
||||||
'tcldll' string (default depends on the build)
|
'tcldll' string (default depends on the build)
|
||||||
global
|
global
|
||||||
|
@ -765,6 +765,7 @@ $quote eval.txt /*$quote*
|
|||||||
'notagbsearch' options.txt /*'notagbsearch'*
|
'notagbsearch' options.txt /*'notagbsearch'*
|
||||||
'notagrelative' options.txt /*'notagrelative'*
|
'notagrelative' options.txt /*'notagrelative'*
|
||||||
'notagstack' options.txt /*'notagstack'*
|
'notagstack' options.txt /*'notagstack'*
|
||||||
|
'notagstackcopy' options.txt /*'notagstackcopy'*
|
||||||
'notbi' options.txt /*'notbi'*
|
'notbi' options.txt /*'notbi'*
|
||||||
'notbidi' options.txt /*'notbidi'*
|
'notbidi' options.txt /*'notbidi'*
|
||||||
'notbs' options.txt /*'notbs'*
|
'notbs' options.txt /*'notbs'*
|
||||||
@ -776,6 +777,7 @@ $quote eval.txt /*$quote*
|
|||||||
'notf' options.txt /*'notf'*
|
'notf' options.txt /*'notf'*
|
||||||
'notgc' options.txt /*'notgc'*
|
'notgc' options.txt /*'notgc'*
|
||||||
'notgst' options.txt /*'notgst'*
|
'notgst' options.txt /*'notgst'*
|
||||||
|
'notgstcp' options.txt /*'notgstcp'*
|
||||||
'notildeop' options.txt /*'notildeop'*
|
'notildeop' options.txt /*'notildeop'*
|
||||||
'notimeout' options.txt /*'notimeout'*
|
'notimeout' options.txt /*'notimeout'*
|
||||||
'notitle' options.txt /*'notitle'*
|
'notitle' options.txt /*'notitle'*
|
||||||
@ -1196,6 +1198,7 @@ $quote eval.txt /*$quote*
|
|||||||
'tagrelative' options.txt /*'tagrelative'*
|
'tagrelative' options.txt /*'tagrelative'*
|
||||||
'tags' options.txt /*'tags'*
|
'tags' options.txt /*'tags'*
|
||||||
'tagstack' options.txt /*'tagstack'*
|
'tagstack' options.txt /*'tagstack'*
|
||||||
|
'tagstackcopy' options.txt /*'tagstackcopy'*
|
||||||
'tal' options.txt /*'tal'*
|
'tal' options.txt /*'tal'*
|
||||||
'tb' options.txt /*'tb'*
|
'tb' options.txt /*'tb'*
|
||||||
'tbi' options.txt /*'tbi'*
|
'tbi' options.txt /*'tbi'*
|
||||||
@ -1222,6 +1225,7 @@ $quote eval.txt /*$quote*
|
|||||||
'tfu' options.txt /*'tfu'*
|
'tfu' options.txt /*'tfu'*
|
||||||
'tgc' options.txt /*'tgc'*
|
'tgc' options.txt /*'tgc'*
|
||||||
'tgst' options.txt /*'tgst'*
|
'tgst' options.txt /*'tgst'*
|
||||||
|
'tgstcp' options.txt /*'tgstcp'*
|
||||||
'thesaurus' options.txt /*'thesaurus'*
|
'thesaurus' options.txt /*'thesaurus'*
|
||||||
'thesaurusfunc' options.txt /*'thesaurusfunc'*
|
'thesaurusfunc' options.txt /*'thesaurusfunc'*
|
||||||
'tildeop' options.txt /*'tildeop'*
|
'tildeop' options.txt /*'tildeop'*
|
||||||
|
@ -185,6 +185,18 @@ commands explained above the tag stack will look like this:
|
|||||||
The |gettagstack()| function returns the tag stack of a specified window. The
|
The |gettagstack()| function returns the tag stack of a specified window. The
|
||||||
|settagstack()| function modifies the tag stack of a window.
|
|settagstack()| function modifies the tag stack of a window.
|
||||||
|
|
||||||
|
In Vim, the tag stack is local to each window. When a new tab or window is
|
||||||
|
opened (e.g., via |:split| or |:tabnew|), the tag stack is copied from the
|
||||||
|
original window. This allows you to continue tag navigation seamlessly in the
|
||||||
|
new window.
|
||||||
|
|
||||||
|
If you prefer not to copy the tag stack when splitting windows, set the
|
||||||
|
'tagstackcopy' option to off.
|
||||||
|
|
||||||
|
Tag navigation commands (such as :tag, :pop, and CTRL-]) affect only the tag
|
||||||
|
stack of the current window. Each window maintains its own independent tag
|
||||||
|
stack.
|
||||||
|
|
||||||
*tagstack-examples*
|
*tagstack-examples*
|
||||||
Write to the tag stack just like `:tag` but with a user-defined
|
Write to the tag stack just like `:tag` but with a user-defined
|
||||||
jumper#jump_to_tag function: >
|
jumper#jump_to_tag function: >
|
||||||
|
@ -422,7 +422,6 @@ EXTERN char_u *p_ofu; // 'omnifunc'
|
|||||||
EXTERN char_u *p_tsrfu; // 'thesaurusfunc'
|
EXTERN char_u *p_tsrfu; // 'thesaurusfunc'
|
||||||
#endif
|
#endif
|
||||||
EXTERN int p_ci; // 'copyindent'
|
EXTERN int p_ci; // 'copyindent'
|
||||||
EXTERN int p_cptgst; // 'copytagstack'
|
|
||||||
#if defined(FEAT_GUI) && defined(MACOS_X)
|
#if defined(FEAT_GUI) && defined(MACOS_X)
|
||||||
EXTERN int *p_antialias; // 'antialias'
|
EXTERN int *p_antialias; // 'antialias'
|
||||||
#endif
|
#endif
|
||||||
@ -1014,6 +1013,7 @@ EXTERN long p_tl; // 'taglength'
|
|||||||
EXTERN int p_tr; // 'tagrelative'
|
EXTERN int p_tr; // 'tagrelative'
|
||||||
EXTERN char_u *p_tags; // 'tags'
|
EXTERN char_u *p_tags; // 'tags'
|
||||||
EXTERN int p_tgst; // 'tagstack'
|
EXTERN int p_tgst; // 'tagstack'
|
||||||
|
EXTERN int p_tgstcp; // 'tagstackcopy'
|
||||||
#if defined(DYNAMIC_TCL)
|
#if defined(DYNAMIC_TCL)
|
||||||
EXTERN char_u *p_tcldll; // 'tcldll'
|
EXTERN char_u *p_tcldll; // 'tcldll'
|
||||||
#endif
|
#endif
|
||||||
|
@ -727,9 +727,6 @@ static struct vimoption options[] =
|
|||||||
{"copyindent", "ci", P_BOOL|P_VI_DEF|P_VIM,
|
{"copyindent", "ci", P_BOOL|P_VI_DEF|P_VIM,
|
||||||
(char_u *)&p_ci, PV_CI, NULL, NULL,
|
(char_u *)&p_ci, PV_CI, NULL, NULL,
|
||||||
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
|
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
|
||||||
{"copytagstack", "cptgst", P_BOOL|P_VIM,
|
|
||||||
(char_u *)&p_cptgst, PV_NONE, NULL, NULL,
|
|
||||||
{(char_u *)TRUE, (char_u *)TRUE} SCTX_INIT},
|
|
||||||
{"cpoptions", "cpo", P_STRING|P_VIM|P_RALL|P_FLAGLIST,
|
{"cpoptions", "cpo", P_STRING|P_VIM|P_RALL|P_FLAGLIST,
|
||||||
(char_u *)&p_cpo, PV_NONE, did_set_cpoptions, expand_set_cpoptions,
|
(char_u *)&p_cpo, PV_NONE, did_set_cpoptions, expand_set_cpoptions,
|
||||||
{(char_u *)CPO_VI, (char_u *)CPO_VIM}
|
{(char_u *)CPO_VI, (char_u *)CPO_VIM}
|
||||||
@ -2589,6 +2586,9 @@ static struct vimoption options[] =
|
|||||||
{"tagstack", "tgst", P_BOOL|P_VI_DEF,
|
{"tagstack", "tgst", P_BOOL|P_VI_DEF,
|
||||||
(char_u *)&p_tgst, PV_NONE, NULL, NULL,
|
(char_u *)&p_tgst, PV_NONE, NULL, NULL,
|
||||||
{(char_u *)TRUE, (char_u *)0L} SCTX_INIT},
|
{(char_u *)TRUE, (char_u *)0L} SCTX_INIT},
|
||||||
|
{"tagstackcopy", "tgstcp", P_BOOL|P_VIM,
|
||||||
|
(char_u *)&p_tgstcp, PV_NONE, NULL, NULL,
|
||||||
|
{(char_u *)TRUE, (char_u *)TRUE} SCTX_INIT},
|
||||||
{"tcldll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
|
{"tcldll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
|
||||||
#if defined(DYNAMIC_TCL)
|
#if defined(DYNAMIC_TCL)
|
||||||
(char_u *)&p_tcldll, PV_NONE, NULL, NULL,
|
(char_u *)&p_tcldll, PV_NONE, NULL, NULL,
|
||||||
|
@ -114,7 +114,6 @@ NEW_TESTS = \
|
|||||||
test_compiler \
|
test_compiler \
|
||||||
test_conceal \
|
test_conceal \
|
||||||
test_const \
|
test_const \
|
||||||
test_copytagstack \
|
|
||||||
test_cpoptions \
|
test_cpoptions \
|
||||||
test_crash \
|
test_crash \
|
||||||
test_crypt \
|
test_crypt \
|
||||||
@ -399,7 +398,6 @@ NEW_TESTS_RES = \
|
|||||||
test_comparators.res \
|
test_comparators.res \
|
||||||
test_conceal.res \
|
test_conceal.res \
|
||||||
test_const.res \
|
test_const.res \
|
||||||
test_copytagstack.res \
|
|
||||||
test_cpoptions.res \
|
test_cpoptions.res \
|
||||||
test_crash.res \
|
test_crash.res \
|
||||||
test_crypt.res \
|
test_crypt.res \
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
" test 'copytagstack' option
|
|
||||||
|
|
||||||
source check.vim
|
|
||||||
source view_util.vim
|
|
||||||
|
|
||||||
func Test_copytagstack()
|
|
||||||
call writefile(["int Foo;"], 'file.c', 'D')
|
|
||||||
call writefile(["Foo\tfile.c\t1"], 'Xtags', 'D')
|
|
||||||
set tags=Xtags
|
|
||||||
|
|
||||||
tag Foo
|
|
||||||
|
|
||||||
let nr0 = winnr()
|
|
||||||
call assert_equal(1, gettagstack(nr0)['length'])
|
|
||||||
|
|
||||||
split Xtext
|
|
||||||
|
|
||||||
let nr1 = winnr()
|
|
||||||
call assert_equal(1, gettagstack(nr1)['length'])
|
|
||||||
|
|
||||||
set tags&
|
|
||||||
bwipe
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
func Test_nocopytagstack()
|
|
||||||
call writefile(["int Foo;"], 'file.c', 'D')
|
|
||||||
call writefile(["Foo\tfile.c\t1"], 'Xtags', 'D')
|
|
||||||
set tags=Xtags
|
|
||||||
set nocopytagstack
|
|
||||||
|
|
||||||
tag Foo
|
|
||||||
|
|
||||||
let nr0 = winnr()
|
|
||||||
call assert_equal(1, gettagstack(nr0)['length'])
|
|
||||||
|
|
||||||
split Xtext
|
|
||||||
|
|
||||||
let nr1 = winnr()
|
|
||||||
call assert_equal(0, gettagstack(nr1)['length'])
|
|
||||||
|
|
||||||
set tags&
|
|
||||||
set copytagstack&
|
|
||||||
bwipe
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
|
@ -1671,4 +1671,44 @@ func Test_tag_excmd_with_number_vim9script()
|
|||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_tagstackcopy()
|
||||||
|
call writefile(["int Foo;"], 'file.c', 'D')
|
||||||
|
call writefile(["Foo\tfile.c\t1"], 'Xtags', 'D')
|
||||||
|
set tags=Xtags
|
||||||
|
|
||||||
|
tag Foo
|
||||||
|
|
||||||
|
let nr0 = winnr()
|
||||||
|
call assert_equal(1, gettagstack(nr0)['length'])
|
||||||
|
|
||||||
|
split Xtext
|
||||||
|
|
||||||
|
let nr1 = winnr()
|
||||||
|
call assert_equal(1, gettagstack(nr1)['length'])
|
||||||
|
|
||||||
|
set tags&
|
||||||
|
bwipe
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_notagstackcopy()
|
||||||
|
call writefile(["int Foo;"], 'file.c', 'D')
|
||||||
|
call writefile(["Foo\tfile.c\t1"], 'Xtags', 'D')
|
||||||
|
set tags=Xtags
|
||||||
|
set notagstackcopy
|
||||||
|
|
||||||
|
tag Foo
|
||||||
|
|
||||||
|
let nr0 = winnr()
|
||||||
|
call assert_equal(1, gettagstack(nr0)['length'])
|
||||||
|
|
||||||
|
split Xtext
|
||||||
|
|
||||||
|
let nr1 = winnr()
|
||||||
|
call assert_equal(0, gettagstack(nr1)['length'])
|
||||||
|
|
||||||
|
set tags&
|
||||||
|
set tagstackcopy&
|
||||||
|
bwipe
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@ -1559,7 +1559,7 @@ win_init(win_T *newp, win_T *oldp, int flags UNUSED)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// copy tagstack and folds
|
// copy tagstack and folds
|
||||||
if (p_cptgst)
|
if (p_tgstcp)
|
||||||
{
|
{
|
||||||
for (i = 0; i < oldp->w_tagstacklen; i++)
|
for (i = 0; i < oldp->w_tagstacklen; i++)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user