home *** CD-ROM | disk | FTP | other *** search
- To: vim-dev@vim.org
- Subject: Patch 6.1.368
- Fcc: outbox
- From: Bram Moolenaar <Bram@moolenaar.net>
- Mime-Version: 1.0
- Content-Type: text/plain; charset=ISO-8859-1
- Content-Transfer-Encoding: 8bit
- ------------
-
- Patch 6.1.368
- Problem: Completion for ":map" does not include <silent> and <script>.
- ":mkexrc" do not save the <silent> attribute of mappings.
- Solution: Add "<silent>" to the generated map commands when appropriate.
- (David Elstner)
- Add <silent> and <script> to command line completion.
- Files: src/getchar.c
-
-
- *** ../vim61.367/src/getchar.c Sun Jan 5 22:14:46 2003
- --- src/getchar.c Thu Mar 6 22:02:48 2003
- ***************
- *** 2789,2795 ****
- else
- noremap = REMAP_YES;
-
- ! /* Accept <buffer>, <script> and <unique> in any order. */
- for (;;)
- {
- #ifdef FEAT_LOCALMAP
- --- 2789,2795 ----
- else
- noremap = REMAP_YES;
-
- ! /* Accept <buffer>, <silent>, <script> and <unique> in any order. */
- for (;;)
- {
- #ifdef FEAT_LOCALMAP
- ***************
- *** 3621,3628 ****
- --- 3621,3630 ----
- xp->xp_context = EXPAND_MAPPINGS;
- #ifdef FEAT_LOCALMAP
- expand_buffer = FALSE;
- + #endif
- for (;;)
- {
- + #ifdef FEAT_LOCALMAP
- if (STRNCMP(arg, "<buffer>", 8) == 0)
- {
- expand_buffer = TRUE;
- ***************
- *** 3633,3646 ****
- if (STRNCMP(arg, "<unique>", 8) == 0)
- {
- arg = skipwhite(arg + 8);
- - #ifdef FEAT_LOCALMAP
- continue;
- - #endif
- }
- ! #ifdef FEAT_LOCALMAP
- break;
- }
- - #endif
- xp->xp_pattern = arg;
- }
-
- --- 3635,3654 ----
- if (STRNCMP(arg, "<unique>", 8) == 0)
- {
- arg = skipwhite(arg + 8);
- continue;
- }
- ! if (STRNCMP(arg, "<silent>", 8) == 0)
- ! {
- ! arg = skipwhite(arg + 8);
- ! continue;
- ! }
- ! if (STRNCMP(arg, "<script>", 8) == 0)
- ! {
- ! arg = skipwhite(arg + 8);
- ! continue;
- ! }
- break;
- }
- xp->xp_pattern = arg;
- }
-
- ***************
- *** 3663,3668 ****
- --- 3671,3677 ----
- int count;
- int round;
- char_u *p;
- + int i;
-
- validate_maphash();
-
- ***************
- *** 3676,3700 ****
- for (round = 1; round <= 2; ++round)
- {
- count = 0;
- ! #ifdef FEAT_LOCALMAP
- ! if (!expand_buffer)
- {
- ! if (vim_regexec(regmatch, (char_u *)"<buffer>", (colnr_T)0))
- {
- if (round == 1)
- ++count;
- else
- ! (*file)[count++] = vim_strsave((char_u *)"<buffer>");
- }
- }
- ! #endif
- ! if (vim_regexec(regmatch, (char_u *)"<unique>", (colnr_T)0))
- ! {
- ! if (round == 1)
- ! ++count;
- ! else
- ! (*file)[count++] = vim_strsave((char_u *)"<unique>");
- ! }
- for (hash = 0; hash < 256; ++hash)
- {
- if (expand_isabbrev)
- --- 3685,3717 ----
- for (round = 1; round <= 2; ++round)
- {
- count = 0;
- !
- ! for (i = 0; i < 4; ++i)
- {
- ! if (i == 0)
- ! p = (char_u *)"<silent>";
- ! else if (i == 1)
- ! p = (char_u *)"<unique>";
- ! #ifdef FEAT_EVAL
- ! else if (i == 2)
- ! p = (char_u *)"<script>";
- ! #endif
- ! #ifdef FEAT_LOCALMAP
- ! else if (i == 3 && !expand_buffer)
- ! p = (char_u *)"<buffer>";
- ! #endif
- ! else
- ! continue;
- !
- ! if (vim_regexec(regmatch, p, (colnr_T)0))
- {
- if (round == 1)
- ++count;
- else
- ! (*file)[count++] = vim_strsave(p);
- }
- }
- !
- for (hash = 0; hash < 256; ++hash)
- {
- if (expand_isabbrev)
- ***************
- *** 4095,4100 ****
- --- 4112,4119 ----
- if (fprintf(fd, cmd) < 0)
- return FAIL;
- if (buf != NULL && fputs(" <buffer>", fd) < 0)
- + return FAIL;
- + if (mp->m_silent && fputs(" <silent>", fd) < 0)
- return FAIL;
-
- if ( putc(' ', fd) < 0
- *** ../vim61.367/src/version.c Sat Mar 8 22:44:59 2003
- --- src/version.c Sun Mar 9 13:59:13 2003
- ***************
- *** 613,614 ****
- --- 613,616 ----
- { /* Add new patch number below this line */
- + /**/
- + 368,
- /**/
-
- --
- I used to be indecisive, now I'm not sure.
-
- /// 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 ///
-