To: vim-dev@vim.org Subject: patch 5.6.051 Fcc: outbox From: Bram Moolenaar ------------ Patch 5.6.051 Problem: ":tprev" and ":tnext" don't give an error message when trying to go before the first or beyond the last tag. (Robert Webb) Solution: Added error messages. Also: Delay a second when a file-read message is going to overwrite an error message, otherwise it won't be seen. Files: src/fileio.c, src/tag.c *** ../vim-5.6.50/src/fileio.c Fri Mar 31 14:23:11 2000 --- src/fileio.c Sun Apr 2 21:29:16 2000 *************** *** 95,100 **** --- 95,102 ---- msg_scroll_save = msg_scroll; if (shortmess(SHM_OVERALL)) msg_scroll = FALSE; + if (!msg_scroll) /* wait a bit when overwriting an error msg */ + check_for_delay(FALSE); msg_start(); msg_scroll = msg_scroll_save; /* may truncate the message to avoid a hit-return prompt */ *** ../vim-5.6.50/src/tag.c Fri Mar 31 14:23:13 2000 --- src/tag.c Sun Apr 2 21:06:24 2000 *************** *** 146,151 **** --- 146,152 ---- char_u **new_matches; int attr; int use_tagstack; + int skip_msg = FALSE; /* remember the matches for the last used tag */ static int num_matches = 0; *************** *** 314,320 **** --- 315,325 ---- if (cur_match >= MAXCOL) cur_match = MAXCOL - 1; else if (cur_match < 0) + { + EMSG("Cannot go before first matching tag"); + skip_msg = TRUE; cur_match = 0; + } } } *************** *** 629,635 **** --- 634,650 ---- } if (cur_match >= num_matches) + { + if (type == DT_NEXT || type == DT_FIRST) + { + if (num_matches == 1) + EMSG("There is only one matching tag"); + else + EMSG("Cannot go beyond last matching tag"); + skip_msg = TRUE; + } cur_match = num_matches - 1; + } if (use_tagstack) { tagstack[tagstackidx].cur_match = cur_match; *************** *** 649,655 **** #ifdef USE_CSCOPE && type != DT_CSCOPE #endif ! && (num_matches > 1 || ic)) { /* Give an indication of the number of matching tags */ sprintf((char *)msg_buf, "tag %d of %d%s", --- 664,671 ---- #ifdef USE_CSCOPE && type != DT_CSCOPE #endif ! && (num_matches > 1 || ic) ! && !skip_msg) { /* Give an indication of the number of matching tags */ sprintf((char *)msg_buf, "tag %d of %d%s", *** ../vim-5.6.50/src/version.c Sun Apr 2 13:04:17 2000 --- src/version.c Sun Apr 2 21:39:35 2000 *************** *** 420,421 **** --- 420,423 ---- { /* Add new patch number below this line */ + /**/ + 51, /**/ -- It is illegal for anyone to give lighted cigars to dogs, cats, and other domesticated animal kept as pets. [real standing law in Illinois, United States of America] /-/-- Bram Moolenaar --- Bram@moolenaar.net --- http://www.moolenaar.net --\-\ \-\-- Vim: http://www.vim.org ---- ICCF Holland: http://www.vim.org/iccf --/-/