Mercurial > vim
comparison src/tag.c @ 6851:b782813c73a6 v7.4.746
patch 7.4.746
Problem: ":[count]tag" is not always working. (cs86661)
Solution: Set cur_match a bit later. (Hirohito Higashi)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 19 Jun 2015 16:45:43 +0200 |
parents | 8d1ba0a23588 |
children | 6ba7182fb7bd |
comparison
equal
deleted
inserted
replaced
6850:d4aff9ec0c35 | 6851:b782813c73a6 |
---|---|
506 { | 506 { |
507 vim_free(tagmatchname); | 507 vim_free(tagmatchname); |
508 tagmatchname = vim_strsave(name); | 508 tagmatchname = vim_strsave(name); |
509 } | 509 } |
510 | 510 |
511 /* | 511 if (type == DT_TAG || type == DT_SELECT || type == DT_JUMP |
512 * If a count is supplied to the ":tag <name>" command, then | |
513 * jump to count'th matching tag. | |
514 */ | |
515 if (type == DT_TAG && *tag != NUL && count > 0) | |
516 cur_match = count - 1; | |
517 | |
518 if (type == DT_SELECT || type == DT_JUMP | |
519 #if defined(FEAT_QUICKFIX) | 512 #if defined(FEAT_QUICKFIX) |
520 || type == DT_LTAG | 513 || type == DT_LTAG |
521 #endif | 514 #endif |
522 ) | 515 ) |
523 cur_match = MAXCOL - 1; | 516 cur_match = MAXCOL - 1; |
592 cs_print_tags(); | 585 cs_print_tags(); |
593 ask_for_selection = TRUE; | 586 ask_for_selection = TRUE; |
594 } | 587 } |
595 else | 588 else |
596 #endif | 589 #endif |
597 if (type == DT_SELECT || (type == DT_JUMP && num_matches > 1)) | 590 if (type == DT_TAG) |
591 /* | |
592 * If a count is supplied to the ":tag <name>" command, then | |
593 * jump to count'th matching tag. | |
594 */ | |
595 cur_match = count > 0 ? count - 1 : 0; | |
596 else if (type == DT_SELECT || (type == DT_JUMP && num_matches > 1)) | |
598 { | 597 { |
599 /* | 598 /* |
600 * List all the matching tags. | 599 * List all the matching tags. |
601 * Assume that the first match indicates how long the tags can | 600 * Assume that the first match indicates how long the tags can |
602 * be, and align the file names to that. | 601 * be, and align the file names to that. |
988 if (nofile_fname != NULL && error_cur_match != cur_match) | 987 if (nofile_fname != NULL && error_cur_match != cur_match) |
989 smsg((char_u *)_("File \"%s\" does not exist"), nofile_fname); | 988 smsg((char_u *)_("File \"%s\" does not exist"), nofile_fname); |
990 | 989 |
991 | 990 |
992 ic = (matches[cur_match][0] & MT_IC_OFF); | 991 ic = (matches[cur_match][0] & MT_IC_OFF); |
993 if (type != DT_SELECT && type != DT_JUMP | 992 if (type != DT_TAG && type != DT_SELECT && type != DT_JUMP |
994 #ifdef FEAT_CSCOPE | 993 #ifdef FEAT_CSCOPE |
995 && type != DT_CSCOPE | 994 && type != DT_CSCOPE |
996 #endif | 995 #endif |
997 && (num_matches > 1 || ic) | 996 && (num_matches > 1 || ic) |
998 && !skip_msg) | 997 && !skip_msg) |