To: vim-dev@vim.org Subject: Patch 6.2.007 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.007 Problem: Listing tags for Cscope doesn't always work. Solution: Avoid using smgs_attr(). (Sergey Khorev) Files: src/if_cscope.c *** ../vim-6.2.006/src/if_cscope.c Fri May 30 23:16:45 2003 --- src/if_cscope.c Tue Jun 3 20:39:43 2003 *************** *** 1824,1829 **** --- 1824,1831 ---- char *globalcntx = "GLOBAL"; char *cntxformat = " <<%s>>"; char *context; + char *cstag_msg = _("Cscope tag: %s"); + char *csfmt_str = "%4d %6s "; assert (num_matches > 0); *************** *** 1833,1839 **** strcpy(tbuf, matches[0]); ptag = strtok(tbuf, "\t"); ! (void)smsg_attr(hl_attr(HLF_T), (char_u *)_("Cscope tag: %s"), ptag); vim_free(tbuf); --- 1835,1848 ---- strcpy(tbuf, matches[0]); ptag = strtok(tbuf, "\t"); ! newsize = strlen(cstag_msg) + strlen(ptag); ! buf = (char *)alloc(newsize); ! if (buf != NULL) ! { ! bufsize = newsize; ! (void)sprintf(buf, cstag_msg, ptag); ! MSG_PUTS_ATTR(buf, hl_attr(HLF_T)); ! } vim_free(tbuf); *************** *** 1921,1927 **** lno[strlen(lno)-2] = '\0'; /* ignore ;" at the end */ ! (void)smsg_attr(hl_attr(HLF_CM), (char_u *)"%4d %6s ", num, lno); MSG_PUTS_LONG_ATTR(cs_pathcomponents(fname), hl_attr(HLF_CM)); /* compute the required space for the context */ --- 1930,1951 ---- lno[strlen(lno)-2] = '\0'; /* ignore ;" at the end */ ! /* hopefully 'num' (num of matches) will be less than 10^16 */ ! newsize = strlen(csfmt_str) + 16 + strlen(lno); ! if (bufsize < newsize) ! { ! buf = (char *)vim_realloc(buf, newsize); ! if (buf == NULL) ! bufsize = 0; ! else ! bufsize = newsize; ! } ! if (buf != NULL) ! { ! /* csfmt_str = "%4d %6s "; */ ! (void)sprintf(buf, csfmt_str, num, lno); ! MSG_PUTS_ATTR(buf, hl_attr(HLF_CM)); ! } MSG_PUTS_LONG_ATTR(cs_pathcomponents(fname), hl_attr(HLF_CM)); /* compute the required space for the context */ *** ../vim-6.2.006/src/version.c Mon Jun 2 22:26:17 2003 --- src/version.c Tue Jun 3 20:38:45 2003 *************** *** 632,633 **** --- 632,635 ---- { /* Add new patch number below this line */ + /**/ + 7, /**/ -- hundred-and-one symptoms of being an internet addict: 81. At social functions you introduce your husband as "my domain server." /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///