home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / old / 5.6.080 < prev    next >
Encoding:
Internet Message Format  |  2000-06-03  |  3.5 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 5.6.080
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. ------------
  6.  
  7. Patch 5.6.080
  8. Problem:    When jumping to a tag, generating the tags file and jumping to the
  9.         same tag again uses the old search pattern. (Sung-Hyun Nam)
  10. Solution:   Flush cached tag matches when executing an external command.
  11. Files:        src/misc2.c, src/proto/tag.pro, src/tag.c
  12.  
  13.  
  14. *** ../vim-5.6.79/src/misc2.c    Thu Jun  1 19:54:28 2000
  15. --- src/misc2.c    Sun Jun  4 19:58:29 2000
  16. ***************
  17. *** 1991,1996 ****
  18. --- 1991,1998 ----
  19.   #ifdef USE_GUI
  20.       ++hold_gui_events;
  21.   #endif
  22. +     /* The external command may update a tags file, clear cached tags. */
  23. +     tag_freematch();
  24.   
  25.       if (cmd == NULL || *p_sxq == NUL)
  26.       retval = mch_call_shell(cmd, opt);
  27. *** ../vim-5.6.79/src/proto/tag.pro    Sun Jan 16 14:22:58 2000
  28. --- src/proto/tag.pro    Sun Jun  4 19:55:39 2000
  29. ***************
  30. *** 1,5 ****
  31. --- 1,6 ----
  32.   /* tag.c */
  33.   int do_tag __ARGS((char_u *tag, int type, int count, int forceit, int verbose));
  34. + void tag_freematch __ARGS((void));
  35.   void do_tags __ARGS((void));
  36.   int find_tags __ARGS((char_u *pat, int *num_matches, char_u ***matchesp, int flags, int mincount));
  37.   void simplify_filename __ARGS((char_u *filename));
  38. *** ../vim-5.6.79/src/tag.c    Mon Apr  3 09:35:20 2000
  39. --- src/tag.c    Sun Jun  4 19:53:58 2000
  40. ***************
  41. *** 86,91 ****
  42. --- 86,93 ----
  43.   static char_u *bottommsg = (char_u *)"at bottom of tag stack";
  44.   static char_u *topmsg = (char_u *)"at top of tag stack";
  45.   
  46. + static char_u    *tagmatchname = NULL;    /* name of last used tag */
  47.   /*
  48.    * We use ftello() here, if available.  It returns off_t instead of long,
  49.    * which helps if long is 32 bit and off_t is 64 bit.
  50. ***************
  51. *** 153,159 ****
  52.       static int        max_num_matches = 0;  /* limit used for match search */
  53.       static char_u    **matches = NULL;
  54.       static int        flags;
  55. -     static char_u    *matchname = NULL;
  56.   
  57.       if (type == DT_HELP)
  58.       {
  59. --- 155,160 ----
  60. ***************
  61. *** 353,367 ****
  62.           name = tag;
  63.       else
  64.           name = tagstack[tagstackidx].tagname;
  65. !     other_name = (matchname == NULL || STRCMP(matchname, name) != 0);
  66.       if (new_tag
  67.           || (cur_match >= num_matches && max_num_matches != MAXCOL)
  68.           || other_name)
  69.       {
  70.           if (other_name)
  71.           {
  72. !         vim_free(matchname);
  73. !         matchname = vim_strsave(name);
  74.           }
  75.   
  76.           if (type == DT_SELECT || type == DT_JUMP)
  77. --- 354,368 ----
  78.           name = tag;
  79.       else
  80.           name = tagstack[tagstackidx].tagname;
  81. !     other_name = (tagmatchname == NULL || STRCMP(tagmatchname, name) != 0);
  82.       if (new_tag
  83.           || (cur_match >= num_matches && max_num_matches != MAXCOL)
  84.           || other_name)
  85.       {
  86.           if (other_name)
  87.           {
  88. !         vim_free(tagmatchname);
  89. !         tagmatchname = vim_strsave(name);
  90.           }
  91.   
  92.           if (type == DT_SELECT || type == DT_JUMP)
  93. ***************
  94. *** 745,750 ****
  95. --- 746,761 ----
  96.   #endif
  97.   }
  98.   
  99. + /*
  100. +  * Free cached tags.
  101. +  */
  102. +     void
  103. + tag_freematch()
  104. + {
  105. +     vim_free(tagmatchname);
  106. +     tagmatchname = NULL;
  107. + }
  108.       static void
  109.   taglen_advance(l)
  110.       int        l;
  111. *** ../vim-5.6.79/src/version.c    Sun Jun  4 20:10:53 2000
  112. --- src/version.c    Sun Jun  4 20:10:38 2000
  113. ***************
  114. *** 420,421 ****
  115. --- 420,423 ----
  116.   {   /* Add new patch number below this line */
  117. + /**/
  118. +     80,
  119.   /**/
  120.  
  121. -- 
  122. SOLDIER: What?  Ridden on a horse?
  123. ARTHUR:  Yes!
  124. SOLDIER: You're using coconuts!
  125.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  126.  
  127. /-/-- Bram Moolenaar --- Bram@moolenaar.net --- http://www.moolenaar.net --\-\
  128. \-\-- Vim: http://www.vim.org ---- ICCF Holland: http://www.vim.org/iccf --/-/
  129.