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 / 6.1.368 < prev    next >
Encoding:
Internet Message Format  |  2003-03-08  |  4.1 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.368
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.1.368
  11. Problem:    Completion for ":map" does not include <silent> and <script>.
  12.         ":mkexrc" do not save the <silent> attribute of mappings.
  13. Solution:   Add "<silent>" to the generated map commands when appropriate.
  14.         (David Elstner)
  15.         Add <silent> and <script> to command line completion.
  16. Files:        src/getchar.c
  17.  
  18.  
  19. *** ../vim61.367/src/getchar.c    Sun Jan  5 22:14:46 2003
  20. --- src/getchar.c    Thu Mar  6 22:02:48 2003
  21. ***************
  22. *** 2789,2795 ****
  23.       else
  24.       noremap = REMAP_YES;
  25.   
  26. !     /* Accept <buffer>, <script> and <unique> in any order. */
  27.       for (;;)
  28.       {
  29.   #ifdef FEAT_LOCALMAP
  30. --- 2789,2795 ----
  31.       else
  32.       noremap = REMAP_YES;
  33.   
  34. !     /* Accept <buffer>, <silent>, <script> and <unique> in any order. */
  35.       for (;;)
  36.       {
  37.   #ifdef FEAT_LOCALMAP
  38. ***************
  39. *** 3621,3628 ****
  40. --- 3621,3630 ----
  41.       xp->xp_context = EXPAND_MAPPINGS;
  42.   #ifdef FEAT_LOCALMAP
  43.       expand_buffer = FALSE;
  44. + #endif
  45.       for (;;)
  46.       {
  47. + #ifdef FEAT_LOCALMAP
  48.           if (STRNCMP(arg, "<buffer>", 8) == 0)
  49.           {
  50.           expand_buffer = TRUE;
  51. ***************
  52. *** 3633,3646 ****
  53.           if (STRNCMP(arg, "<unique>", 8) == 0)
  54.           {
  55.           arg = skipwhite(arg + 8);
  56. - #ifdef FEAT_LOCALMAP
  57.           continue;
  58. - #endif
  59.           }
  60. ! #ifdef FEAT_LOCALMAP
  61.           break;
  62.       }
  63. - #endif
  64.       xp->xp_pattern = arg;
  65.       }
  66.   
  67. --- 3635,3654 ----
  68.           if (STRNCMP(arg, "<unique>", 8) == 0)
  69.           {
  70.           arg = skipwhite(arg + 8);
  71.           continue;
  72.           }
  73. !         if (STRNCMP(arg, "<silent>", 8) == 0)
  74. !         {
  75. !         arg = skipwhite(arg + 8);
  76. !         continue;
  77. !         }
  78. !         if (STRNCMP(arg, "<script>", 8) == 0)
  79. !         {
  80. !         arg = skipwhite(arg + 8);
  81. !         continue;
  82. !         }
  83.           break;
  84.       }
  85.       xp->xp_pattern = arg;
  86.       }
  87.   
  88. ***************
  89. *** 3663,3668 ****
  90. --- 3671,3677 ----
  91.       int        count;
  92.       int        round;
  93.       char_u    *p;
  94. +     int        i;
  95.   
  96.       validate_maphash();
  97.   
  98. ***************
  99. *** 3676,3700 ****
  100.       for (round = 1; round <= 2; ++round)
  101.       {
  102.       count = 0;
  103. ! #ifdef FEAT_LOCALMAP
  104. !     if (!expand_buffer)
  105.       {
  106. !         if (vim_regexec(regmatch, (char_u *)"<buffer>", (colnr_T)0))
  107.           {
  108.           if (round == 1)
  109.               ++count;
  110.           else
  111. !             (*file)[count++] = vim_strsave((char_u *)"<buffer>");
  112.           }
  113.       }
  114. ! #endif
  115. !     if (vim_regexec(regmatch, (char_u *)"<unique>", (colnr_T)0))
  116. !     {
  117. !         if (round == 1)
  118. !         ++count;
  119. !         else
  120. !         (*file)[count++] = vim_strsave((char_u *)"<unique>");
  121. !     }
  122.       for (hash = 0; hash < 256; ++hash)
  123.       {
  124.           if (expand_isabbrev)
  125. --- 3685,3717 ----
  126.       for (round = 1; round <= 2; ++round)
  127.       {
  128.       count = 0;
  129. !     for (i = 0; i < 4; ++i)
  130.       {
  131. !         if (i == 0)
  132. !         p = (char_u *)"<silent>";
  133. !         else if (i == 1)
  134. !         p = (char_u *)"<unique>";
  135. ! #ifdef FEAT_EVAL
  136. !         else if (i == 2)
  137. !         p = (char_u *)"<script>";
  138. ! #endif
  139. ! #ifdef FEAT_LOCALMAP
  140. !         else if (i == 3 && !expand_buffer)
  141. !         p = (char_u *)"<buffer>";
  142. ! #endif
  143. !         else
  144. !         continue;
  145. !         if (vim_regexec(regmatch, p, (colnr_T)0))
  146.           {
  147.           if (round == 1)
  148.               ++count;
  149.           else
  150. !             (*file)[count++] = vim_strsave(p);
  151.           }
  152.       }
  153.       for (hash = 0; hash < 256; ++hash)
  154.       {
  155.           if (expand_isabbrev)
  156. ***************
  157. *** 4095,4100 ****
  158. --- 4112,4119 ----
  159.               if (fprintf(fd, cmd) < 0)
  160.               return FAIL;
  161.               if (buf != NULL && fputs(" <buffer>", fd) < 0)
  162. +             return FAIL;
  163. +             if (mp->m_silent && fputs(" <silent>", fd) < 0)
  164.               return FAIL;
  165.   
  166.               if (       putc(' ', fd) < 0
  167. *** ../vim61.367/src/version.c    Sat Mar  8 22:44:59 2003
  168. --- src/version.c    Sun Mar  9 13:59:13 2003
  169. ***************
  170. *** 613,614 ****
  171. --- 613,616 ----
  172.   {   /* Add new patch number below this line */
  173. + /**/
  174. +     368,
  175.   /**/
  176.  
  177. -- 
  178. I used to be indecisive, now I'm not sure.
  179.  
  180.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  181. ///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
  182. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  183.  \\\     Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
  184.