mirror of
https://github.com/vim/vim.git
synced 2025-07-04 23:07: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.
|
||||
Also see 'preserveindent'.
|
||||
|
||||
*'copytagstack'* *'cptgst'* *'nocopytagstack'* *'nocptgst'*
|
||||
'copytagstack' 'cptgst' boolean (default: on)
|
||||
global
|
||||
Copy tag stack when splitting window.
|
||||
|
||||
*'cpoptions'* *'cpo'* *cpo*
|
||||
'cpoptions' 'cpo' string (Vim default: "aABceFsz",
|
||||
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
|
||||
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' string (default depends on the build)
|
||||
global
|
||||
|
@ -765,6 +765,7 @@ $quote eval.txt /*$quote*
|
||||
'notagbsearch' options.txt /*'notagbsearch'*
|
||||
'notagrelative' options.txt /*'notagrelative'*
|
||||
'notagstack' options.txt /*'notagstack'*
|
||||
'notagstackcopy' options.txt /*'notagstackcopy'*
|
||||
'notbi' options.txt /*'notbi'*
|
||||
'notbidi' options.txt /*'notbidi'*
|
||||
'notbs' options.txt /*'notbs'*
|
||||
@ -776,6 +777,7 @@ $quote eval.txt /*$quote*
|
||||
'notf' options.txt /*'notf'*
|
||||
'notgc' options.txt /*'notgc'*
|
||||
'notgst' options.txt /*'notgst'*
|
||||
'notgstcp' options.txt /*'notgstcp'*
|
||||
'notildeop' options.txt /*'notildeop'*
|
||||
'notimeout' options.txt /*'notimeout'*
|
||||
'notitle' options.txt /*'notitle'*
|
||||
@ -1196,6 +1198,7 @@ $quote eval.txt /*$quote*
|
||||
'tagrelative' options.txt /*'tagrelative'*
|
||||
'tags' options.txt /*'tags'*
|
||||
'tagstack' options.txt /*'tagstack'*
|
||||
'tagstackcopy' options.txt /*'tagstackcopy'*
|
||||
'tal' options.txt /*'tal'*
|
||||
'tb' options.txt /*'tb'*
|
||||
'tbi' options.txt /*'tbi'*
|
||||
@ -1222,6 +1225,7 @@ $quote eval.txt /*$quote*
|
||||
'tfu' options.txt /*'tfu'*
|
||||
'tgc' options.txt /*'tgc'*
|
||||
'tgst' options.txt /*'tgst'*
|
||||
'tgstcp' options.txt /*'tgstcp'*
|
||||
'thesaurus' options.txt /*'thesaurus'*
|
||||
'thesaurusfunc' options.txt /*'thesaurusfunc'*
|
||||
'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
|
||||
|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*
|
||||
Write to the tag stack just like `:tag` but with a user-defined
|
||||
jumper#jump_to_tag function: >
|
||||
|
@ -422,7 +422,6 @@ EXTERN char_u *p_ofu; // 'omnifunc'
|
||||
EXTERN char_u *p_tsrfu; // 'thesaurusfunc'
|
||||
#endif
|
||||
EXTERN int p_ci; // 'copyindent'
|
||||
EXTERN int p_cptgst; // 'copytagstack'
|
||||
#if defined(FEAT_GUI) && defined(MACOS_X)
|
||||
EXTERN int *p_antialias; // 'antialias'
|
||||
#endif
|
||||
@ -1014,6 +1013,7 @@ EXTERN long p_tl; // 'taglength'
|
||||
EXTERN int p_tr; // 'tagrelative'
|
||||
EXTERN char_u *p_tags; // 'tags'
|
||||
EXTERN int p_tgst; // 'tagstack'
|
||||
EXTERN int p_tgstcp; // 'tagstackcopy'
|
||||
#if defined(DYNAMIC_TCL)
|
||||
EXTERN char_u *p_tcldll; // 'tcldll'
|
||||
#endif
|
||||
|
@ -727,9 +727,6 @@ static struct vimoption options[] =
|
||||
{"copyindent", "ci", P_BOOL|P_VI_DEF|P_VIM,
|
||||
(char_u *)&p_ci, PV_CI, NULL, NULL,
|
||||
{(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,
|
||||
(char_u *)&p_cpo, PV_NONE, did_set_cpoptions, expand_set_cpoptions,
|
||||
{(char_u *)CPO_VI, (char_u *)CPO_VIM}
|
||||
@ -2589,6 +2586,9 @@ static struct vimoption options[] =
|
||||
{"tagstack", "tgst", P_BOOL|P_VI_DEF,
|
||||
(char_u *)&p_tgst, PV_NONE, NULL, NULL,
|
||||
{(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,
|
||||
#if defined(DYNAMIC_TCL)
|
||||
(char_u *)&p_tcldll, PV_NONE, NULL, NULL,
|
||||
|
@ -114,7 +114,6 @@ NEW_TESTS = \
|
||||
test_compiler \
|
||||
test_conceal \
|
||||
test_const \
|
||||
test_copytagstack \
|
||||
test_cpoptions \
|
||||
test_crash \
|
||||
test_crypt \
|
||||
@ -399,7 +398,6 @@ NEW_TESTS_RES = \
|
||||
test_comparators.res \
|
||||
test_conceal.res \
|
||||
test_const.res \
|
||||
test_copytagstack.res \
|
||||
test_cpoptions.res \
|
||||
test_crash.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!
|
||||
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
|
||||
|
@ -1559,7 +1559,7 @@ win_init(win_T *newp, win_T *oldp, int flags UNUSED)
|
||||
}
|
||||
|
||||
// copy tagstack and folds
|
||||
if (p_cptgst)
|
||||
if (p_tgstcp)
|
||||
{
|
||||
for (i = 0; i < oldp->w_tagstacklen; i++)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user