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.041 < prev    next >
Encoding:
Internet Message Format  |  2002-11-04  |  3.8 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.041
  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.041
  11. Problem:    ":mkvimrc" doesn't handle a mapping that has a leading space in
  12.         the rhs. (Davyd Ondrejko)
  13. Solution:   Insert a CTRL-V before the leading space.  Also display leading
  14.         and trailing white space in <> form.
  15. Files:        src/getchar.c, src/message.c
  16.  
  17.  
  18. *** ../vim61.040/src/getchar.c    Tue Apr 23 22:22:00 2002
  19. --- src/getchar.c    Mon Apr 29 22:53:52 2002
  20. ***************
  21. *** 4051,4061 ****
  22.    * return FAIL for failure, OK otherwise
  23.    */
  24.       int
  25. ! put_escstr(fd, str, what)
  26.       FILE    *fd;
  27. !     char_u    *str;
  28.       int        what;
  29.   {
  30.       int        c;
  31.       int        modifiers;
  32.   
  33. --- 4051,4062 ----
  34.    * return FAIL for failure, OK otherwise
  35.    */
  36.       int
  37. ! put_escstr(fd, strstart, what)
  38.       FILE    *fd;
  39. !     char_u    *strstart;
  40.       int        what;
  41.   {
  42. +     char_u    *str = strstart;
  43.       int        c;
  44.       int        modifiers;
  45.   
  46. ***************
  47. *** 4136,4141 ****
  48. --- 4137,4144 ----
  49.        * prevent them from misinterpreted in DoOneCmd().
  50.        * A space, Tab and '"' has to be escaped with a backslash to
  51.        * prevent it to be misinterpreted in do_set().
  52. +      * A space has to be escaped with a CTRL-V when it's at the start of a
  53. +      * ":map" rhs.
  54.        * A '<' has to be escaped with a CTRL-V to prevent it being
  55.        * interpreted as the start of a special key name.
  56.        * A space in the lhs of a :map needs a CTRL-V.
  57. ***************
  58. *** 4145,4152 ****
  59.           if (putc('\\', fd) < 0)
  60.           return FAIL;
  61.       }
  62. !     else if (c < ' ' || c > '~' || c == '|' || (what != 2 && c == '<')
  63. !                            || (what == 0 && c == ' '))
  64.       {
  65.           if (putc(Ctrl_V, fd) < 0)
  66.           return FAIL;
  67. --- 4148,4157 ----
  68.           if (putc('\\', fd) < 0)
  69.           return FAIL;
  70.       }
  71. !     else if (c < ' ' || c > '~' || c == '|'
  72. !         || (what == 0 && c == ' ')
  73. !         || (what == 1 && str == strstart && c == ' ')
  74. !         || (what != 2 && c == '<'))
  75.       {
  76.           if (putc(Ctrl_V, fd) < 0)
  77.           return FAIL;
  78. *** ../vim61.040/src/message.c    Fri Mar 15 21:36:35 2002
  79. --- src/message.c    Mon Apr 29 22:56:26 2002
  80. ***************
  81. *** 1162,1171 ****
  82.    * the character/string -- webb
  83.    */
  84.       int
  85. ! msg_outtrans_special(str, from)
  86. !     char_u    *str;
  87.       int        from;    /* TRUE for lhs of a mapping */
  88.   {
  89.       int        retval = 0;
  90.       char_u    *string;
  91.       int        attr;
  92. --- 1162,1172 ----
  93.    * the character/string -- webb
  94.    */
  95.       int
  96. ! msg_outtrans_special(strstart, from)
  97. !     char_u    *strstart;
  98.       int        from;    /* TRUE for lhs of a mapping */
  99.   {
  100. +     char_u    *str = strstart;
  101.       int        retval = 0;
  102.       char_u    *string;
  103.       int        attr;
  104. ***************
  105. *** 1174,1180 ****
  106.       attr = hl_attr(HLF_8);
  107.       while (*str != NUL)
  108.       {
  109. !     string = str2special(&str, from);
  110.       len = vim_strsize(string);
  111.       /* Highlight special keys */
  112.       msg_puts_attr(string, len > 1
  113. --- 1175,1188 ----
  114.       attr = hl_attr(HLF_8);
  115.       while (*str != NUL)
  116.       {
  117. !     /* Leading and trailing spaces need to be displayed in <> form. */
  118. !     if ((str == strstart || str[1] == NUL) && *str == ' ')
  119. !     {
  120. !         string = (char_u *)"<Space>";
  121. !         ++str;
  122. !     }
  123. !     else
  124. !         string = str2special(&str, from);
  125.       len = vim_strsize(string);
  126.       /* Highlight special keys */
  127.       msg_puts_attr(string, len > 1
  128. *** ../vim61.040/src/version.c    Mon Apr 29 21:59:52 2002
  129. --- src/version.c    Mon Apr 29 22:50:28 2002
  130. ***************
  131. *** 608,609 ****
  132. --- 608,611 ----
  133.   {   /* Add new patch number below this line */
  134. + /**/
  135. +     41,
  136.   /**/
  137.  
  138. -- 
  139. It's not hard to meet expenses, they're everywhere. 
  140.  
  141.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  142. ///   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   \\\
  143. \\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  144.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  145.