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.174 < prev    next >
Encoding:
Internet Message Format  |  2002-09-06  |  3.9 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.174
  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.174
  11. Problem:    It is difficult to know in a script whether an option not only
  12.         exists but really works.
  13. Solution:   Add "exists('+option')".
  14. Files:        runtime/doc/eval.txt, src/eval.c
  15.  
  16.  
  17. *** ../vim61.173/runtime/doc/eval.txt    Sun Jun 23 21:29:33 2002
  18. --- runtime/doc/eval.txt    Sat Sep  7 21:05:07 2002
  19. ***************
  20. *** 1,4 ****
  21. ! *eval.txt*      For Vim version 6.1.  Last change: 2002 May 12
  22.   
  23.   
  24.             VIM REFERENCE MANUAL    by Bram Moolenaar
  25. --- 1,4 ----
  26. ! *eval.txt*      For Vim version 6.1.  Last change: 2002 Sep 07
  27.   
  28.   
  29.             VIM REFERENCE MANUAL    by Bram Moolenaar
  30. ***************
  31. *** 1176,1181 ****
  32. --- 1176,1182 ----
  33.           contains one of these:
  34.               &option-name    Vim option (only checks if it exists,
  35.                       not if it really works)
  36. +             +option-name    Vim option that works.
  37.               $ENVNAME    environment variable (could also be
  38.                       done by comparing with an empty
  39.                       string)
  40. *** ../vim61.173/src/eval.c    Fri Aug 30 22:27:17 2002
  41. --- src/eval.c    Sat Sep  7 21:04:47 2002
  42. ***************
  43. *** 2026,2032 ****
  44.   
  45.   /*
  46.    * Get an option value.
  47. !  * "arg" points to the '&' before the option name.
  48.    * "arg" is advanced to character after the option name.
  49.    * Return OK or FAIL.
  50.    */
  51. --- 2026,2032 ----
  52.   
  53.   /*
  54.    * Get an option value.
  55. !  * "arg" points to the '&' or '+' before the option name.
  56.    * "arg" is advanced to character after the option name.
  57.    * Return OK or FAIL.
  58.    */
  59. ***************
  60. *** 2041,2046 ****
  61. --- 2041,2047 ----
  62.       char_u    *stringval;
  63.       int        opt_type;
  64.       int        c;
  65. +     int        working = (**arg == '+');    /* has("+option") */
  66.       int        ret = OK;
  67.       int        opt_flags;
  68.   
  69. ***************
  70. *** 2095,2100 ****
  71. --- 2096,2103 ----
  72.           retvar->var_val.var_string = stringval;
  73.       }
  74.       }
  75. +     else if (working && (opt_type == -2 || opt_type == -1))
  76. +     ret = FAIL;
  77.   
  78.       *option_end = c;            /* put back for error messages */
  79.       *arg = option_end;
  80. ***************
  81. *** 3409,3415 ****
  82.           vim_free(p);
  83.       }
  84.       }
  85. !     else if (*p == '&')            /* option */
  86.       n = (get_option_var(&p, NULL, TRUE) == OK);
  87.       else if (*p == '*')            /* internal or user defined function */
  88.       {
  89. --- 3412,3418 ----
  90.           vim_free(p);
  91.       }
  92.       }
  93. !     else if (*p == '&' || *p == '+')            /* option */
  94.       n = (get_option_var(&p, NULL, TRUE) == OK);
  95.       else if (*p == '*')            /* internal or user defined function */
  96.       {
  97. ***************
  98. *** 7555,7561 ****
  99.   
  100.   /*
  101.    * Skip over the name of an option: "&option", "&g:option" or "&l:option".
  102. !  * "arg" points to the "&" when called, to "option" when returning.
  103.    * Returns NULL when no option name found.  Otherwise pointer to the char
  104.    * after the option name.
  105.    */
  106. --- 7558,7564 ----
  107.   
  108.   /*
  109.    * Skip over the name of an option: "&option", "&g:option" or "&l:option".
  110. !  * "arg" points to the "&" or '+' when called, to "option" when returning.
  111.    * Returns NULL when no option name found.  Otherwise pointer to the char
  112.    * after the option name.
  113.    */
  114. *** ../vim61.173/src/version.c    Sat Sep  7 17:16:30 2002
  115. --- src/version.c    Sat Sep  7 22:18:04 2002
  116. ***************
  117. *** 608,609 ****
  118. --- 608,611 ----
  119.   {   /* Add new patch number below this line */
  120. + /**/
  121. +     174,
  122.   /**/
  123.  
  124. -- 
  125. TIM: To the north there lies a cave,  the cave of Caerbannog, wherein, carved
  126.      in mystic runes, upon the very living rock, the last words of Olfin
  127.      Bedwere of Rheged make plain the last resting place of the most Holy
  128.      Grail.
  129.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  130.  
  131.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  132. ///          Creator of Vim - Vi IMproved -- http://www.vim.org          \\\
  133. \\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  134.  \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
  135.