comparison src/tag.c @ 16164:213b88f89597 v8.1.1087

patch 8.1.1087: tag stack is incorrect after CTRL-T and then :tag commit https://github.com/vim/vim/commit/7559dcef6cfd0ba13271088fff51b8979fee950b Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 30 19:12:02 2019 +0100 patch 8.1.1087: tag stack is incorrect after CTRL-T and then :tag Problem: tag stack is incorrect after CTRL-T and then :tag Solution: Handle DT_TAG differently. (test by Andy Massimino, closes https://github.com/vim/vim/issues/3944, closes #4177)
author Bram Moolenaar <Bram@vim.org>
date Sat, 30 Mar 2019 19:15:04 +0100
parents 570a296aa0b4
children 4d7ee5609652
comparison
equal deleted inserted replaced
16163:9478a3d8b3f7 16164:213b88f89597
502 { 502 {
503 vim_free(tagmatchname); 503 vim_free(tagmatchname);
504 tagmatchname = vim_strsave(name); 504 tagmatchname = vim_strsave(name);
505 } 505 }
506 506
507 if (type == DT_TAG || type == DT_SELECT || type == DT_JUMP 507 if (type == DT_SELECT || type == DT_JUMP
508 #if defined(FEAT_QUICKFIX) 508 #if defined(FEAT_QUICKFIX)
509 || type == DT_LTAG 509 || type == DT_LTAG
510 #endif 510 #endif
511 ) 511 )
512 cur_match = MAXCOL - 1; 512 cur_match = MAXCOL - 1;
513 max_num_matches = cur_match + 1; 513 if (type == DT_TAG)
514 max_num_matches = MAXCOL;
515 else
516 max_num_matches = cur_match + 1;
514 517
515 /* when the argument starts with '/', use it as a regexp */ 518 /* when the argument starts with '/', use it as a regexp */
516 if (!no_regexp && *name == '/') 519 if (!no_regexp && *name == '/')
517 { 520 {
518 flags = TAG_REGEXP; 521 flags = TAG_REGEXP;
581 cs_print_tags(); 584 cs_print_tags();
582 ask_for_selection = TRUE; 585 ask_for_selection = TRUE;
583 } 586 }
584 else 587 else
585 #endif 588 #endif
586 if (type == DT_TAG) 589 if (type == DT_TAG && *tag != NUL)
587 /* 590 /*
588 * If a count is supplied to the ":tag <name>" command, then 591 * If a count is supplied to the ":tag <name>" command, then
589 * jump to count'th matching tag. 592 * jump to count'th matching tag.
590 */ 593 */
591 cur_match = count > 0 ? count - 1 : 0; 594 cur_match = count > 0 ? count - 1 : 0;